;(function($, window, undefined){ 'use strict'; var $body=$('body'); $.DLMenu=function(options, element){ this.$el=$(element); this._init(options); }; $.DLMenu.defaults={ animationClasses:{ classin:'dl-animate-in-1', classout:'dl-animate-out-1' }, onLevelClick:function(el, name){ return false; }, onLinkClick:function(el, ev){ return false; }, backLabel: 'Back', showCurrentLabel: 'Show this page', useActiveItemAsBackLabel: false, useActiveItemAsLink: true }; $.DLMenu.prototype={ _init:function(options){ this.options=$.extend(true, {}, $.DLMenu.defaults, options); this._config(); var animEndEventNames={ 'WebkitAnimation':'webkitAnimationEnd', 'OAnimation':'oAnimationEnd', 'msAnimation':'MSAnimationEnd', 'animation':'animationend', "MozAnimation":"animationend" }, transEndEventNames={ 'WebkitTransition':'webkitTransitionEnd', 'MozTransition':'transitionend', 'OTransition':'oTransitionEnd', 'msTransition':'MSTransitionEnd', 'transition':'transitionend' }; if(animEndEventNames[ window.supportedAnimation ]!=undefined){ this.animEndEventName=animEndEventNames[ window.supportedAnimation ] + '.dlmenu'; }else{ this.animEndEventName=animEndEventNames[ 'animation' ] + '.dlmenu'; } if(transEndEventNames[ window.supportedTransition ]!=undefined){ this.transEndEventName=transEndEventNames[ window.supportedTransition ] + '.dlmenu'; }else{ this.transEndEventName=transEndEventNames[ 'transition' ] + '.dlmenu'; } this.supportAnimations=window.supportsAnimations; this.supportTransitions=window.supportsTransitions; this._initEvents(); }, _config:function(){ var self=this; this.open=false; this.$trigger=this.$el.children('.dl-trigger'); this.$menu=this.$el.children('ul.dl-menu'); this.$menuitems=this.$menu.find('li:not(.dl-back)'); this.$el.find('ul.dl-submenu').prepend('
  • ' + this.options.backLabel + '
  • '); this.$back=this.$menu.find('li.dl-back'); if(this.options.useActiveItemAsBackLabel){ this.$back.each(function(){ var $this=$(this), parentLabel=$this.parents('li:first').find('a:first').text(); $this.find('a').html(parentLabel); }); } if(this.options.useActiveItemAsLink){ this.$el.find('ul.dl-submenu').prepend(function(){ var activeLi=$(this).parents('li:not(.dl-back):first'); var parentli=activeLi.find('a:first'); if(activeLi.hasClass('mobile-clickable')) return '
  • ' + self.options.showCurrentLabel + '
  • '; else return ''; }); }}, _initEvents:function(){ var self=this; this.$trigger.on('click.dlmenu', function(){ if(self.open){ self._closeMenu(); }else{ self._openMenu(); $body.off('click').children().on('click.dlmenu', function(){ self._closeMenu() ; }); } return false; }); this.$menuitems.on('click.dlmenu', function(event){ event.stopPropagation(); var $item=$(this), $submenu=$item.children('ul.dl-submenu'); if(($submenu.length > 0)&&!($(event.currentTarget).hasClass('dl-subviewopen'))){ var $flyin=$submenu.clone().css('opacity', 0).insertAfter(self.$menu), onAnimationEndFn=function(){ self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classout).addClass('dl-subview'); $item.addClass('dl-subviewopen').parents('.dl-subviewopen:first').removeClass('dl-subviewopen').addClass('dl-subview'); $flyin.remove(); }; setTimeout(function(){ $flyin.addClass(self.options.animationClasses.classin); self.$menu.addClass(self.options.animationClasses.classout); if(self.supportAnimations){ self.$menu.on(self.animEndEventName, onAnimationEndFn); }else{ onAnimationEndFn.call(); } self.options.onLevelClick($item, $item.children('a:first').text()); }); return false; }else{ self.options.onLinkClick($item, event); }}); this.$back.on('click.dlmenu', function(event){ var $this=$(this), $submenu=$this.parents('ul.dl-submenu:first'), $item=$submenu.parent(), $flyin=$submenu.clone().insertAfter(self.$menu); var onAnimationEndFn=function(){ self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classin); $flyin.remove(); }; setTimeout(function(){ $flyin.addClass(self.options.animationClasses.classout); self.$menu.addClass(self.options.animationClasses.classin); if(self.supportAnimations){ self.$menu.on(self.animEndEventName, onAnimationEndFn); }else{ onAnimationEndFn.call(); } $item.removeClass('dl-subviewopen'); var $subview=$this.parents('.dl-subview:first'); if($subview.is('li')){ $subview.addClass('dl-subviewopen'); } $subview.removeClass('dl-subview'); }); return false; }); }, closeMenu:function(){ if(this.open){ this._closeMenu(); }}, _closeMenu:function(){ var self=this, onTransitionEndFn=function(){ self.$menu.off(self.transEndEventName); self._resetMenu(); }; this.$menu.removeClass('dl-menuopen'); this.$menu.addClass('dl-menu-toggle'); this.$trigger.removeClass('dl-active'); if(this.supportTransitions){ this.$menu.on(this.transEndEventName, onTransitionEndFn); }else{ onTransitionEndFn.call(); } this.open=false; }, openMenu:function(){ if(!this.open){ this._openMenu(); }}, _openMenu:function(){ var self=this; $body.off('click').on('click.dlmenu', function(){ self._closeMenu() ; }); this.$menu.addClass('dl-menuopen dl-menu-toggle').on(this.transEndEventName, function(){ $(this).removeClass('dl-menu-toggle'); }); this.$trigger.addClass('dl-active'); this.open=true; }, _resetMenu:function(){ this.$menu.removeClass('dl-subview'); this.$menuitems.removeClass('dl-subview dl-subviewopen'); }}; var logError=function(message){ if(window.console){ window.console.error(message); }}; $.fn.dlmenu=function(options){ if(typeof options==='string'){ var args=Array.prototype.slice.call(arguments, 1); this.each(function(){ var instance=$.data(this, 'dlmenu'); if(!instance){ logError("cannot call methods on dlmenu prior to initialization; " + "attempted to call method '" + options + "'"); return; } if(!$.isFunction(instance[options])||options.charAt(0)==="_"){ logError("no such method '" + options + "' for dlmenu instance"); return; } instance[ options ].apply(instance, args); }); }else{ this.each(function(){ var instance=$.data(this, 'dlmenu'); if(instance){ instance._init(); }else{ instance=$.data(this, 'dlmenu', new $.DLMenu(options, this)); }}); } return this; };})(jQuery, window); function supportsTransitions(){ return getSupportedTransition()!=''; } function getSupportedTransition(){ var b=document.body||document.documentElement, s=b.style, p='transition'; if(typeof s[p]=='string'){ return p; } var v=['Moz', 'webkit', 'Webkit', 'Khtml', 'O', 'ms']; p=p.charAt(0).toUpperCase() + p.substr(1); for (var i=0; i li:last-child'); primaryMenu.style.display=''; logoItem.style.marginLeft=''; logoItem.style.marginRight=''; if(windowWidth < 1212){ return; } primaryMenu.style.display='block'; var pageCenter=windowWidth / 2, logoOffset=getElementPosition(logoItem), offset=pageCenter - logoOffset.left - logoItem.offsetWidth / 2; logoItem.style.marginLeft=offset + 'px'; var primaryMenuOffsetWidth=primaryMenu.offsetWidth, primaryMenuOffsetLeft=getElementPosition(primaryMenu).left, lastItemOffsetWidth=lastItem.offsetWidth, lastItemOffsetLeft=getElementPosition(lastItem).left, rightItemsOffset=primaryMenuOffsetWidth - lastItemOffsetLeft - lastItemOffsetWidth + primaryMenuOffsetLeft; logoItem.style.marginRight=rightItemsOffset + 'px'; }else{ if(windowWidth < 1212){ primaryNavigation.style.textAlign=''; primaryMenu.style.position=''; primaryMenu.style.left=''; return; } primaryNavigation.style.textAlign='left'; primaryMenu.style.left=0 + 'px'; var pageCenter=windowWidth / 2, logoOffset=getElementPosition(document.querySelector('#site-header .header-main #primary-navigation .menu-item-logo')), pageOffset=getElementPosition(page), offset=pageCenter - (logoOffset.left - pageOffset.left) - document.querySelector('#site-header .header-main #primary-navigation .menu-item-logo').offsetWidth / 2; primaryMenu.style.position='relative'; primaryMenu.style.left=offset + 'px'; }}, 50); } window.fixMenuLogoPosition=fixMenuLogoPosition; })(); (function($){ var isVerticalMenu=$('.header-main').hasClass('header-layout-vertical'), isHamburgerMenu=$('.header-main').hasClass('header-layout-fullwidth_hamburger'); $(window).resize(function(){ window.updateGemClientSize(false); window.updateGemInnerSize(); }); window.menuResizeTimeoutHandler=false; var megaMenuSettings={}; function getOffset(elem){ if(elem.getBoundingClientRect&&window.gemBrowser.platform.name!='ios'){ var bound=elem.getBoundingClientRect(), html=elem.ownerDocument.documentElement, htmlScroll=getScroll(html), elemScrolls=getScrolls(elem), isFixed=(styleString(elem, 'position')=='fixed'); return { x: parseInt(bound.left) + elemScrolls.x + ((isFixed) ? 0:htmlScroll.x) - html.clientLeft, y: parseInt(bound.top) + elemScrolls.y + ((isFixed) ? 0:htmlScroll.y) - html.clientTop };} var element=elem, position={x: 0, y: 0}; if(isBody(elem)) return position; while (element&&!isBody(element)){ position.x +=element.offsetLeft; position.y +=element.offsetTop; if(window.gemBrowser.name=='firefox'){ if(!borderBox(element)){ position.x +=leftBorder(element); position.y +=topBorder(element); } var parent=element.parentNode; if(parent&&styleString(parent, 'overflow')!='visible'){ position.x +=leftBorder(parent); position.y +=topBorder(parent); }}else if(element!=elem&&window.gemBrowser.name=='safari'){ position.x +=leftBorder(element); position.y +=topBorder(element); } element=element.offsetParent; } if(window.gemBrowser.name=='firefox'&&!borderBox(elem)){ position.x -=leftBorder(elem); position.y -=topBorder(elem); } return position; }; function getScroll(elem){ return {x: window.pageXOffset||document.documentElement.scrollLeft, y: window.pageYOffset||document.documentElement.scrollTop};}; function getScrolls(elem){ var element=elem.parentNode, position={x: 0, y: 0}; while (element&&!isBody(element)){ position.x +=element.scrollLeft; position.y +=element.scrollTop; element=element.parentNode; } return position; }; function styleString(element, style){ return $(element).css(style); }; function styleNumber(element, style){ return parseInt(styleString(element, style))||0; }; function borderBox(element){ return styleString(element, '-moz-box-sizing')=='border-box'; }; function topBorder(element){ return styleNumber(element, 'border-top-width'); }; function leftBorder(element){ return styleNumber(element, 'border-left-width'); }; function isBody(element){ return (/^(?:body|html)$/i).test(element.tagName); }; function checkMegaMenuSettings(){ if(window.customMegaMenuSettings==undefined||window.customMegaMenuSettings==null){ return false; } var uri=window.location.pathname; window.customMegaMenuSettings.forEach(function(item){ for (var i=0; i < item.urls.length; i++){ if(uri.match(item.urls[i])){ megaMenuSettings[item.menuItem]=item.data; }} }); } function fixMegaMenuWithSettings(){ checkMegaMenuSettings(); $('#primary-menu > li.megamenu-enable').each(function(){ var m=this.className.match(/(menu-item-(\d+))/); if(!m){ return; } var itemId=parseInt(m[2]); if(megaMenuSettings[itemId]==undefined||megaMenuSettings[itemId]==null){ return; } var $item=$('> ul', this); if(megaMenuSettings[itemId].masonry!=undefined){ if(megaMenuSettings[itemId].masonry){ $item.addClass('megamenu-masonry'); }else{ $item.removeClass('megamenu-masonry'); }} if(megaMenuSettings[itemId].style!=undefined){ $(this).removeClass('megamenu-style-default megamenu-style-grid').addClass('megamenu-style-' + megaMenuSettings[itemId].style); } var css={}; if(megaMenuSettings[itemId].backgroundImage!=undefined){ css.backgroundImage=megaMenuSettings[itemId].backgroundImage; } if(megaMenuSettings[itemId].backgroundPosition!=undefined){ css.backgroundPosition=megaMenuSettings[itemId].backgroundPosition; } if(megaMenuSettings[itemId].padding!=undefined){ css.padding=megaMenuSettings[itemId].padding; } if(megaMenuSettings[itemId].borderRight!=undefined){ css.borderRight=megaMenuSettings[itemId].borderRight; } $item.css(css); }); } function isResponsiveMenuVisible(){ if(window.gemSettings.tabletLandscape){ return window.gemOptions.clientWidth < 1213; } if(window.gemSettings.tabletPortrait){ return window.gemOptions.clientWidth < 980; } return window.gemOptions.clientWidth < 768&&!$('.header-layout-overlay').length; } window.isResponsiveMenuVisible=isResponsiveMenuVisible; function isTopAreaVisible(){ return window.gemSettings.topAreaMobileDisable ? window.gemOptions.clientWidth >=768:true; } window.isTopAreaVisible=isTopAreaVisible; function isVerticalToggleVisible(){ return window.gemOptions.clientWidth > 1600; } $('#primary-menu > li.megamenu-enable').hover(function(){ fix_megamenu_position(this); }, function(){} ); function fix_megamenu_position(elem){ if(!$('.megamenu-inited', elem).length&&isResponsiveMenuVisible()){ return false; } var $item=$('> ul', elem); if($item.length==0) return; var self=$item.get(0); var default_item_css={ width: 'auto', height: 'auto' }; if(!isVerticalMenu&&!isHamburgerMenu){ default_item_css.left=0; } $item .removeClass('megamenu-masonry-inited megamenu-fullwidth') .css(default_item_css); $(' > li', $item).css({ left: 0, top: 0 }).each(function(){ var old_width=$(this).data('old-width')||-1; if(old_width!=-1){ $(this).width(old_width).data('old-width', -1); }}); if(isResponsiveMenuVisible()){ return; } if(isVerticalMenu){ var container_width=window.gemOptions.clientWidth - $('#site-header-wrapper').outerWidth(); }else if(isHamburgerMenu){ var container_width=window.gemOptions.clientWidth - $('#primary-menu').outerWidth(); }else{ var $container=$item.closest('.header-main'), container_width=$container.width(), container_padding_left=parseInt($container.css('padding-left')), container_padding_right=parseInt($container.css('padding-right')), parent_width=$item.parent().outerWidth(); } var megamenu_width=$item.outerWidth(); if(megamenu_width > container_width){ megamenu_width=container_width; var new_megamenu_width=container_width - parseInt($item.css('padding-left')) - parseInt($item.css('padding-right')); var columns=$item.data('megamenu-columns')||4; var column_width=parseFloat(new_megamenu_width - columns * parseInt($(' > li:first', $item).css('margin-left'))) / columns; var column_width_int=parseInt(column_width); $(' > li', $item).each(function(){ $(this).data('old-width', $(this).width()).css('width', column_width_int); }); $item.addClass('megamenu-fullwidth').width(new_megamenu_width - (column_width - column_width_int) * columns); } if(!isVerticalMenu&&!isHamburgerMenu){ if(megamenu_width > parent_width){ var left=-(megamenu_width - parent_width) / 2; }else{ var left=0; } var container_offset=getOffset($container[0]); var megamenu_offset=getOffset(self); if((megamenu_offset.x - container_offset.x - container_padding_left + left) < 0){ left=-(megamenu_offset.x - container_offset.x - container_padding_left); } if((megamenu_offset.x + megamenu_width + left) > (container_offset.x + $container.outerWidth() - container_padding_right)){ left -=(megamenu_offset.x + megamenu_width + left) - (container_offset.x + $container.outerWidth() - container_padding_right); } $item.css('left', left).css('left'); } if($item.hasClass('megamenu-masonry')){ var positions={}, max_bottom=0; $item.width($item.width() - 1); var new_row_height=$('.megamenu-new-row', $item).outerHeight() + parseInt($('.megamenu-new-row', $item).css('margin-bottom')); $('> li.menu-item', $item).each(function(){ var pos=$(this).position(); if(positions[pos.left]!=null&&positions[pos.left]!=undefined){ var top_position=positions[pos.left]; }else{ var top_position=pos.top; } positions[pos.left]=top_position + $(this).outerHeight() + new_row_height + parseInt($(this).css('margin-bottom')); if(positions[pos.left] > max_bottom) max_bottom=positions[pos.left]; $(this).css({ left: pos.left, top: top_position }) }); $item.height(max_bottom - new_row_height - parseInt($item.css('padding-top')) - 1); $item.addClass('megamenu-masonry-inited'); } if($item.hasClass('megamenu-empty-right')){ var mega_width=$item.width(); var max_rights={ columns: [], position: -1 }; $('> li.menu-item', $item).removeClass('megamenu-no-right-border').each(function(){ var pos=$(this).position(); var column_right_position=pos.left + $(this).width(); if(column_right_position > max_rights.position){ max_rights.position=column_right_position; max_rights.columns=[]; } if(column_right_position==max_rights.position){ max_rights.columns.push($(this)); }}); if(max_rights.columns.length&&max_rights.position >=(mega_width - 7)){ max_rights.columns.forEach(function($li){ $li.addClass('megamenu-no-right-border'); }); }} if(isVerticalMenu||isHamburgerMenu){ var clientHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight, itemOffset=$item.offset(), itemHeight=$item.outerHeight(), scrollTop=$(window).scrollTop(); if(itemOffset.top - scrollTop + itemHeight > clientHeight){ $item.css({ top: clientHeight - itemOffset.top + scrollTop - itemHeight - 20 }); }} $item.addClass('megamenu-inited'); } function primary_menu_reinit(){ if(isResponsiveMenuVisible()){ var $submenuDisabled=$('#primary-navigation .dl-submenu-disabled'); if($submenuDisabled.length){ $submenuDisabled.addClass('dl-submenu').removeClass('dl-submenu-disabled'); } if($('#primary-menu').hasClass('no-responsive')){ $('#primary-menu').removeClass('no-responsive'); } if(!$('#primary-navigation').hasClass('responsive')){ $('#primary-navigation').addClass('responsive'); } window.fixMenuLogoPosition(); }else{ $('#primary-navigation').addClass('without-transition'); $('#primary-navigation .dl-submenu').addClass('dl-submenu-disabled').removeClass('dl-submenu'); $('#primary-menu').addClass('no-responsive'); $('#primary-navigation').removeClass('responsive'); window.fixMenuLogoPosition(); setTimeout(function(){ $('#primary-menu ul:not(.minicart ul), #primary-menu .minicart, #primary-menu .minisearch').each(function(){ var $item=$(this); var self=this; $item.removeClass('invert'); $item.removeClass('vertical-invert'); $item.css({top: ''}); if($item.closest('.megamenu-enable').size()==0&&$item.closest('.header-layout-overlay').size()==0){ if($item.offset().left - $('#page').offset().left + $item.outerWidth() > $('#page').width()){ $item.addClass('invert'); } if($('.header-main').first().hasClass('header-style-vertical')){ if($item.offset().top - $('#site-header-wrapper').offset().top + $item.outerHeight() > $(window).height()){ $item.addClass('vertical-invert'); $item.css({ top: -($item.offset().top - $('#site-header-wrapper').offset().top + $item.outerHeight() - $(window).height()) + 'px' }); }}else if($item, $item.parents('#primary-menu ul').length){ if($item.offset().top - $('#site-header-wrapper').offset().top + $item.outerHeight() > $(window).height()){ $item.addClass('vertical-invert'); $item.css({ top: -($item.offset().top - $('#site-header-wrapper').offset().top + $item.outerHeight() - $(window).height()) + 'px' }); }} }}); }, 50); $('#primary-navigation').removeClass('without-transition'); }} $('#primary-navigation .submenu-languages').addClass('dl-submenu'); $('#primary-navigation > ul> li.menu-item-language').addClass('menu-item-parent'); fixMegaMenuWithSettings(); $('#primary-navigation').dlmenu({ animationClasses: { classin:'dl-animate-in', classout:'dl-animate-out' }, onLevelClick: function (el, name){ $('html, body').animate({ scrollTop:0 }); }, backLabel: thegem_dlmenu_settings.backLabel, showCurrentLabel: thegem_dlmenu_settings.showCurrentLabel }); primary_menu_reinit(); $('.hamburger-toggle').click(function(e){ e.preventDefault(); $(this).closest('#primary-navigation').toggleClass('hamburger-active'); $('.hamburger-overlay').toggleClass('active'); }); $('.overlay-toggle').click(function(e){ e.preventDefault(); if($('.menu-overlay').hasClass('active')){ $('.menu-overlay').removeClass('active'); $(this).closest('#primary-navigation').addClass('close'); $(this).closest('#primary-navigation').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e){ $(this).closest('#primary-navigation').removeClass('overlay-active close'); $('.overlay-menu-wrapper').removeClass('active'); }); }else{ $('.overlay-menu-wrapper').addClass('active'); $(this).closest('#primary-navigation').off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'); $(this).closest('#primary-navigation').addClass('overlay-active').removeClass('close'); $('.menu-overlay').addClass('active'); }}); $('.header-layout-overlay #primary-menu a').click(function(e){ if(!$('#primary-menu').hasClass('no-responsive')) return ; var $itemLink=$(this); var $item=$itemLink.closest('li'); if($item.hasClass('menu-item-parent')){ e.preventDefault(); if($item.hasClass('menu-overlay-item-open')){ $(' > ul, .menu-overlay-item-open > ul', $item).each(function(){ $(this).css({height: $(this).outerHeight()+'px'}); }); setTimeout(function(){ $(' > ul, .menu-overlay-item-open > ul', $item).css({height: 0}); $('.menu-overlay-item-open', $item).add($item).removeClass('menu-overlay-item-open'); }, 50); }else{ var $oldActive=$('#primary-navigation .menu-overlay-item-open').not($item.parents()); $('> ul', $oldActive).not($item.parents()).each(function(){ $(this).css({height: $(this).outerHeight()+'px'}); }); setTimeout(function(){ $('> ul', $oldActive).not($item.parents()).css({height: 0}); $oldActive.removeClass('menu-overlay-item-open'); }, 50); $('> ul', $item).css({height: 'auto'}); var itemHeight=$('> ul', $item).outerHeight(); $('> ul', $item).css({height: 0}); setTimeout(function(){ $('> ul', $item).css({height: itemHeight+'px'}); $item.addClass('menu-overlay-item-open'); $('> ul', $item).one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){ $('> ul', $item).css({height: 'auto'}); }); }, 50); }} }); $('.vertical-toggle').click(function(e){ e.preventDefault(); $(this).closest('#site-header-wrapper').toggleClass('vertical-active'); }); $(function(){ $(window).resize(function(){ if(window.menuResizeTimeoutHandler){ clearTimeout(window.menuResizeTimeoutHandler); } window.menuResizeTimeoutHandler=setTimeout(primary_menu_reinit, 50); }); }); $('#primary-navigation a').click(function(e){ var $item=$(this); if($('#primary-menu').hasClass('no-responsive')&&window.gemSettings.isTouch&&$item.next('ul').length){ e.preventDefault(); }}); })(jQuery); (function (document, navigator, CACHE, IE9TO11){ if(IE9TO11) document.addEventListener('DOMContentLoaded', function (){ [].forEach.call(document.querySelectorAll('use'), function (use){ var svg=use.parentNode, url=use.getAttribute('xlink:href').split('#'), url_root=url[0], url_hash=url[1], xhr=CACHE[url_root]=CACHE[url_root]||new XMLHttpRequest(); if(!xhr.s){ xhr.s=[]; xhr.open('GET', url_root); xhr.onload=function (){ var x=document.createElement('x'), s=xhr.s; x.innerHTML=xhr.responseText; xhr.onload=function (){ s.splice(0).map(function (array){ var g=x.querySelector('#' + array[2]); if(g) array[0].replaceChild(g.cloneNode(true), array[1]); }); }; xhr.onload(); }; xhr.send(); } xhr.s.push([svg, use, url_hash]); if(xhr.responseText) xhr.onload(); }); }); })( document, navigator, {}, /Trident\/[567]\b/.test(navigator.userAgent) ); (function($){ $.fn.checkbox=function(){ $(this).each(function(){ var $el=$(this); var typeClass=$el.attr('type'); $el.hide(); $el.next('.'+typeClass+'-sign').remove(); var $checkbox=$('').insertAfter($el); $checkbox.click(function(){ if($el.attr('type')=='radio'){ $el.prop('checked', true).trigger('change').trigger('click'); }else{ $el.prop('checked', !($el.is(':checked'))).trigger('change'); }}); $el.change(function(){ $('input[name="'+$el.attr('name')+'"]').each(function(){ if($(this).is(':checked')){ $(this).next('.'+$(this).attr('type')+'-sign').addClass('checked'); }else{ $(this).next('.'+$(this).attr('type')+'-sign').removeClass('checked'); }}); }); if($el.is(':checked')){ $checkbox.addClass('checked'); }else{ $checkbox.removeClass('checked'); }}); } $.fn.combobox=function(){ $(this).each(function(){ var $el=$(this); $el.insertBefore($el.parent('.combobox-wrapper')); $el.next('.combobox-wrapper').remove(); $el.css({ 'opacity': 0, 'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0 }); var $comboWrap=$('').insertAfter($el); var $text=$('').appendTo($comboWrap); var $button=$('').appendTo($comboWrap); $el.appendTo($comboWrap); $el.change(function(){ $text.text($('option:selected', $el).text()); }); $text.text($('option:selected', $el).text()); $el.comboWrap=$comboWrap; }); }})(jQuery); jQuery.easing['jswing']=jQuery.easing['swing']; jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d){ return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d){ return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d){ return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d){ return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d){ return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d){ return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d){ return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d){ return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d){ return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d){ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d){ return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d){ return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d){ if(t==0) return b; if(t==d) return b+c; if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d){ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d){ return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d){ if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b; }, easeOutElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b; }, easeInOutElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5); if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d){ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d){ if((t/=d) < (1/2.75)){ return c*(7.5625*t*t) + b; }else if(t < (2/2.75)){ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; }else if(t < (2.5/2.75)){ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; }else{ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; }}, easeInOutBounce: function (x, t, b, c, d){ if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; }}); (function($){ function HeaderAnimation(el, options){ this.el=el; this.$el=$(el); this.options={ startTop: 1 }; $.extend(this.options, options); this.initialize(); } HeaderAnimation.prototype={ initialize: function(){ var self=this; this.$wrapper=$('#site-header-wrapper'); this.$topArea=$('#top-area'); this.topAreaInSiteHeader=$('#site-header #top-area').length > 0; this.$headerMain=$('.header-main', this.$el); this.hasAdminBar=document.body.className.indexOf('admin-bar')!=-1; this.htmlOffset=this.hasAdminBar ? parseInt($('html').css('margin-top')):0; this.scrollTop=0; this.topOffset=0; this.settedWrapperHeight=false; this.initedForDesktop=false; this.hideWrapper=this.$wrapper.hasClass('site-header-wrapper-transparent'); this.videoBackground=$('.page-title-block .gem-video-background').length&&$('.page-title-block .gem-video-background').data('headerup'); if(this.$el.hasClass('header-on-slideshow')&&$('#main-content > *').first().is('.gem-slideshow, .block-slideshow')){ this.$wrapper.css({position: 'absolute'}); } if(this.$el.hasClass('header-on-slideshow')&&$('#main-content > *').first().is('.gem-slideshow, .block-slideshow')){ this.$wrapper.addClass('header-on-slideshow'); }else{ this.$el.removeClass('header-on-slideshow'); } if(this.videoBackground){ this.$el.addClass('header-on-slideshow'); this.$wrapper.addClass('header-on-slideshow'); } this.initForDesktop(); $(window).scroll(function(){ self.scrollHandler(); }); $(window).resize(function(){ self.initForDesktop(); self.scrollHandler(); setTimeout(function(){ self.initializeHeight(); }, 350); }); }, initForDesktop: function(){ if(window.isResponsiveMenuVisible()||this.initedForDesktop){ return false; } this.initializeHeight(); this.initializeStyles(); if(this.$topArea.length&&!this.topAreaInSiteHeader) this.options.startTop=this.$topArea.outerHeight(); }, setMargin: function($img){ var $small=$img.siblings('img.small'), w=0; if(this.$headerMain.hasClass('logo-position-right')){ w=$small.width(); }else if(this.$headerMain.hasClass('logo-position-center')||this.$headerMain.hasClass('logo-position-menu_center')){ w=$img.width(); var smallWidth=$small.width(), offset=(w - smallWidth) / 2; w=smallWidth + offset; $small.css('margin-right', offset + 'px'); } if(!w){ w=$img.width(); } $small.css('margin-left', '-' + w + 'px'); $img.parent().css('min-width', w + 'px'); $small.show(); }, initializeStyles: function(){ var self=this; if(this.$headerMain.hasClass('logo-position-menu_center')){ var $img=$('#primary-navigation .menu-item-logo a .logo img.default', this.$el); }else{ var $img=$('.site-title a .logo img.default', this.$el); } if($img.length&&$img.is(':visible')&&$img[0].complete){ self.setMargin($img); self.initializeHeight(); }else{ $img.on('load error', function(){ self.setMargin($img); self.initializeHeight(); }); }}, initializeHeight: function(){ if(window.isResponsiveMenuVisible()){ this.$el.removeClass('shrink fixed'); if(this.settedWrapperHeight){ this.$wrapper.css({ height: '' }); } return false; } if(this.hideWrapper){ return false; } var shrink=this.$el.hasClass('shrink'); this.$el.removeClass('shrink'); var elHeight=this.$el.outerHeight(); this.$wrapper.height(elHeight); this.settedWrapperHeight=true; if(shrink){ this.$el.addClass('shrink'); }}, updateTopOffset: function(){ var offset=this.htmlOffset; if(this.$wrapper.hasClass('header-on-slideshow')&&!this.$el.hasClass('fixed')) offset=0; if(this.$topArea.length&&!this.topAreaInSiteHeader&&window.isTopAreaVisible()){ var top_area_height=this.$topArea.outerHeight(); this.options.startTop=top_area_height; if(this.scrollTop < top_area_height) offset +=top_area_height - this.scrollTop; } if(this.topOffset!=offset){ this.topOffset=offset; this.$el.css('top', offset + 'px'); }}, scrollHandler: function(){ if(window.isResponsiveMenuVisible()){ return false; } if(this.getScrollY() >=this.options.startTop){ if(!this.$el.hasClass('shrink')){ var shrinkClass='shrink fixed'; if(window.gemSettings.fillTopArea){ shrinkClass +=' fill'; } this.$el.addClass(shrinkClass) if(this.hasAdminBar){ this.$el.css({ top: this.htmlOffset }); }} }else{ if(this.$el.hasClass('shrink')){ this.$el.removeClass('shrink fixed') if(this.hasAdminBar){ this.$el.css({ top: '' }); }} }}, updateScrollTop: function(){ this.scrollTop=$(window).scrollTop(); }, getScrollY: function(){ return window.pageYOffset||document.documentElement.scrollTop; }, }; $.fn.headerAnimation=function(options){ options=options||{}; return new HeaderAnimation(this.get(0), options); };})(jQuery); (function (){ var defaultOptions={ frameRate:150, animationTime:400, stepSize:100, pulseAlgorithm:true, pulseScale:4, pulseNormalize:1, accelerationDelta:50, accelerationMax:3, keyboardSupport:true, arrowScroll:50, touchpadSupport:false, fixedBackground:true, excluded:'' }; var options=defaultOptions; var isExcluded=false; var isFrame=false; var direction={ x: 0, y: 0 }; var initDone=false; var root=document.documentElement; var activeElement; var observer; var refreshSize; var deltaBuffer=[]; var isMac=/^Mac/.test(navigator.platform); var key={ left: 37, up: 38, right: 39, down: 40, spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 }; function initTest(){ if(options.keyboardSupport){ addEvent('keydown', keydown); }} function init(){ if(initDone||!document.body) return; initDone=true; var body=document.body; var html=document.documentElement; var windowHeight=window.innerHeight; var scrollHeight=body.scrollHeight; root=(document.compatMode.indexOf('CSS') >=0) ? html:body; activeElement=body; initTest(); if(top!=self){ isFrame=true; } else if(scrollHeight > windowHeight && (body.offsetHeight <=windowHeight || html.offsetHeight <=windowHeight)){ var fullPageElem=document.createElement('div'); fullPageElem.style.cssText='position:absolute; z-index:-10000; ' + 'top:0; left:0; right:0; height:' + root.scrollHeight + 'px'; document.body.appendChild(fullPageElem); var pendingRefresh; refreshSize=function (){ if(pendingRefresh) return; pendingRefresh=setTimeout(function (){ if(isExcluded) return; fullPageElem.style.height='0'; fullPageElem.style.height=root.scrollHeight + 'px'; pendingRefresh=null; }, 500); }; setTimeout(refreshSize, 10); addEvent('resize', refreshSize); var config={ attributes: true, childList: true, characterData: false }; observer=new MutationObserver(refreshSize); observer.observe(body, config); if(root.offsetHeight <=windowHeight){ var clearfix=document.createElement('div'); clearfix.style.clear='both'; body.appendChild(clearfix); }} if(!options.fixedBackground&&!isExcluded){ body.style.backgroundAttachment='scroll'; html.style.backgroundAttachment='scroll'; }} function cleanup(){ observer&&observer.disconnect(); removeEvent(wheelEvent, wheel); removeEvent('mousedown', mousedown); removeEvent('keydown', keydown); removeEvent('resize', refreshSize); removeEvent('load', init); } var que=[]; var pending=false; var lastScroll=Date.now(); function scrollArray(elem, left, top){ directionCheck(left, top); if(options.accelerationMax!=1){ var now=Date.now(); var elapsed=now - lastScroll; if(elapsed < options.accelerationDelta){ var factor=(1 + (50 / elapsed)) / 2; if(factor > 1){ factor=Math.min(factor, options.accelerationMax); left *=factor; top *=factor; }} lastScroll=Date.now(); } que.push({ x: left, y: top, lastX: (left < 0) ? 0.99:-0.99, lastY: (top < 0) ? 0.99:-0.99, start: Date.now() }); if(pending){ return; } var scrollWindow=(elem===document.body); var step=function (time){ var now=Date.now(); var scrollX=0; var scrollY=0; for (var i=0; i < que.length; i++){ var item=que[i]; var elapsed=now - item.start; var finished=(elapsed >=options.animationTime); var position=(finished) ? 1:elapsed / options.animationTime; if(options.pulseAlgorithm){ position=pulse(position); } var x=(item.x * position - item.lastX) >> 0; var y=(item.y * position - item.lastY) >> 0; scrollX +=x; scrollY +=y; item.lastX +=x; item.lastY +=y; if(finished){ que.splice(i, 1); i--; }} if(scrollWindow){ window.scrollBy(scrollX, scrollY); }else{ if(scrollX) elem.scrollLeft +=scrollX; if(scrollY) elem.scrollTop +=scrollY; } if(!left&&!top){ que=[]; } if(que.length){ requestFrame(step, elem, (1000 / options.frameRate + 1)); }else{ pending=false; }}; requestFrame(step, elem, 0); pending=true; } function wheel(event){ if(!initDone){ init(); } var target=event.target; var overflowing=overflowingAncestor(target); if(!overflowing||event.defaultPrevented||event.ctrlKey){ return true; } if(isNodeName(activeElement, 'embed') || (isNodeName(target, 'embed')&&/\.pdf/i.test(target.src)) || isNodeName(activeElement, 'object')){ return true; } var deltaX=-event.wheelDeltaX||event.deltaX||0; var deltaY=-event.wheelDeltaY||event.deltaY||0; if(isMac){ if(event.wheelDeltaX&&isDivisible(event.wheelDeltaX, 120)){ deltaX=-120 * (event.wheelDeltaX / Math.abs(event.wheelDeltaX)); } if(event.wheelDeltaY&&isDivisible(event.wheelDeltaY, 120)){ deltaY=-120 * (event.wheelDeltaY / Math.abs(event.wheelDeltaY)); }} if(!deltaX&&!deltaY){ deltaY=-event.wheelDelta||0; } if(event.deltaMode===1){ deltaX *=40; deltaY *=40; } if(!options.touchpadSupport&&isTouchpad(deltaY)){ return true; } if(Math.abs(deltaX) > 1.2){ deltaX *=options.stepSize / 120; } if(Math.abs(deltaY) > 1.2){ deltaY *=options.stepSize / 120; } scrollArray(overflowing, deltaX, deltaY); event.preventDefault(); scheduleClearCache(); } function keydown(event){ var target=event.target; var modifier=event.ctrlKey||event.altKey||event.metaKey || (event.shiftKey&&event.keyCode!==key.spacebar); if(!document.contains(activeElement)){ activeElement=document.activeElement; } var inputNodeNames=/^(textarea|select|embed|object)$/i; var buttonTypes=/^(button|submit|radio|checkbox|file|color|image)$/i; if(inputNodeNames.test(target.nodeName) || isNodeName(target, 'input')&&!buttonTypes.test(target.type) || isNodeName(activeElement, 'video') || isInsideYoutubeVideo(event) || target.isContentEditable || event.defaultPrevented || modifier){ return true; } if((isNodeName(target, 'button') || isNodeName(target, 'input')&&buttonTypes.test(target.type)) && event.keyCode===key.spacebar){ return true; } var shift, x=0, y=0; var elem=overflowingAncestor(activeElement); var clientHeight=elem.clientHeight; if(elem==document.body){ clientHeight=window.innerHeight; } switch (event.keyCode){ case key.up: y=-options.arrowScroll; break; case key.down: y=options.arrowScroll; break; case key.spacebar: shift=event.shiftKey ? 1:-1; y=-shift * clientHeight * 0.9; break; case key.pageup: y=-clientHeight * 0.9; break; case key.pagedown: y=clientHeight * 0.9; break; case key.home: y=-elem.scrollTop; break; case key.end: var damt=elem.scrollHeight - elem.scrollTop - clientHeight; y=(damt > 0) ? damt+10:0; break; case key.left: x=-options.arrowScroll; break; case key.right: x=options.arrowScroll; break; default: return true; } scrollArray(elem, x, y); event.preventDefault(); scheduleClearCache(); } function mousedown(event){ activeElement=event.target; } var uniqueID=(function (){ var i=0; return function (el){ return el.uniqueID||(el.uniqueID=i++); };})(); var cache={}; var clearCacheTimer; function scheduleClearCache(){ clearTimeout(clearCacheTimer); clearCacheTimer=setInterval(function (){ cache={};}, 1*1000); } function setCache(elems, overflowing){ for (var i=elems.length; i--;) cache[uniqueID(elems[i])]=overflowing; return overflowing; } function overflowingAncestor(el){ var elems=[]; var body=document.body; var rootScrollHeight=root.scrollHeight; do { var cached=cache[uniqueID(el)]; if(cached){ return setCache(elems, cached); } elems.push(el); if(rootScrollHeight===el.scrollHeight){ var topOverflowsNotHidden=overflowNotHidden(root)&&overflowNotHidden(body); var isOverflowCSS=topOverflowsNotHidden||overflowAutoOrScroll(root); if(isFrame&&isContentOverflowing(root) || !isFrame&&isOverflowCSS){ return setCache(elems, getScrollRoot()); }}else if(isContentOverflowing(el)&&overflowAutoOrScroll(el)){ return setCache(elems, el); }} while (el=el.parentElement); } function isContentOverflowing(el){ return (el.clientHeight + 10 < el.scrollHeight); } function overflowNotHidden(el){ var overflow=getComputedStyle(el, '').getPropertyValue('overflow-y'); return (overflow!=='hidden'); } function overflowAutoOrScroll(el){ var overflow=getComputedStyle(el, '').getPropertyValue('overflow-y'); return (overflow==='scroll'||overflow==='auto'); } function addEvent(type, fn){ window.addEventListener(type, fn, false); } function removeEvent(type, fn){ window.removeEventListener(type, fn, false); } function isNodeName(el, tag){ return (el.nodeName||'').toLowerCase()===tag.toLowerCase(); } function directionCheck(x, y){ x=(x > 0) ? 1:-1; y=(y > 0) ? 1:-1; if(direction.x!==x||direction.y!==y){ direction.x=x; direction.y=y; que=[]; lastScroll=0; }} var deltaBufferTimer; if(window.localStorage&&localStorage.SS_deltaBuffer){ deltaBuffer=localStorage.SS_deltaBuffer.split(','); } function isTouchpad(deltaY){ if(!deltaY) return; if(!deltaBuffer.length){ deltaBuffer=[deltaY, deltaY, deltaY]; } deltaY=Math.abs(deltaY); deltaBuffer.push(deltaY); deltaBuffer.shift(); clearTimeout(deltaBufferTimer); deltaBufferTimer=setTimeout(function (){ if(window.localStorage){ localStorage.SS_deltaBuffer=deltaBuffer.join(','); }}, 1000); return !allDeltasDivisableBy(120)&&!allDeltasDivisableBy(100); } function isDivisible(n, divisor){ return (Math.floor(n / divisor)==n / divisor); } function allDeltasDivisableBy(divisor){ return (isDivisible(deltaBuffer[0], divisor) && isDivisible(deltaBuffer[1], divisor) && isDivisible(deltaBuffer[2], divisor)); } function isInsideYoutubeVideo(event){ var elem=event.target; var isControl=false; if(document.URL.indexOf ('www.youtube.com/watch')!=-1){ do { isControl=(elem.classList && elem.classList.contains('html5-video-controls')); if(isControl) break; } while (elem=elem.parentNode); } return isControl; } var requestFrame=(function (){ return (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback, element, delay){ window.setTimeout(callback, delay||(1000/60)); }); })(); var MutationObserver=(window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver); var getScrollRoot=(function(){ var SCROLL_ROOT; return function(){ if(!SCROLL_ROOT){ var dummy=document.createElement('div'); dummy.style.cssText='height:10000px;width:1px;'; document.body.appendChild(dummy); var bodyScrollTop=document.body.scrollTop; var docElScrollTop=document.documentElement.scrollTop; window.scrollBy(0, 3); if(document.body.scrollTop!=bodyScrollTop) (SCROLL_ROOT=document.body); else (SCROLL_ROOT=document.documentElement); window.scrollBy(0, -3); document.body.removeChild(dummy); } return SCROLL_ROOT; };})(); function pulse_(x){ var val, start, expx; x=x * options.pulseScale; if(x < 1){ val=x - (1 - Math.exp(-x)); }else{ start=Math.exp(-1); x -=1; expx=1 - Math.exp(-x); val=start + (expx * (1 - start)); } return val * options.pulseNormalize; } function pulse(x){ if(x >=1) return 1; if(x <=0) return 0; if(options.pulseNormalize==1){ options.pulseNormalize /=pulse_(1); } return pulse_(x); } var userAgent=window.navigator.userAgent; var isEdge=/Edge/.test(userAgent); var isChrome=/chrome/i.test(userAgent)&&!isEdge; var isSafari=/safari/i.test(userAgent)&&!isEdge; var isMobile=/mobile/i.test(userAgent); var isEnabledForBrowser=(isChrome||isEdge)&&!isMobile&&!isMac; var wheelEvent; if('onwheel' in document.createElement('div')) wheelEvent='wheel'; else if('onmousewheel' in document.createElement('div')) wheelEvent='mousewheel'; if(wheelEvent&&isEnabledForBrowser){ addEvent(wheelEvent, wheel); addEvent('mousedown', mousedown); addEvent('load', init); } function SmoothScroll(optionsToSet){ for (var key in optionsToSet) if(defaultOptions.hasOwnProperty(key)) options[key]=optionsToSet[key]; } SmoothScroll.destroy=cleanup; if(window.SmoothScrollOptions) SmoothScroll(window.SmoothScrollOptions); if(typeof define==='function'&&define.amd) define(function(){ return SmoothScroll; }); else if('object'==typeof exports) module.exports=SmoothScroll; else window.SmoothScroll=SmoothScroll; })(); (function ($){ var lazy_effects={ 'clip': { show: function(element){ $(element.el).animate({ transform: 'scale(1.1)', }, { duration:200, }).animate({ transform: 'scale(1)', }, { duration:200, complete: function(){ if(element.options.queueType=='sync') element.finishAnimation(); }}) }}, 'fading': { show: function(element){ $(element.el).css({ opacity: 0 }).animate({ opacity: 1 }, { duration:400, complete: function(){ if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'drop-right': { show: function(element){ var left=parseInt($(element.el).width()/15); $(element.el).wrapInner('
    ').css({ opacity: 1 }); $(element.el).find('> div').css({ opacity: 0 }).animate({ opacity: 1, left: 0, }, { duration:700, complete: function(){ var $div=$(element.el).find('> div'); $(element.el).append($div.find('> *')); $div.remove(); if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'drop-right-without-wrap': { show: function(element){ var left=parseInt($(element.el).outerWidth()/15); $(element.el).css({ opacity: 0, position: 'relative', left: left, transition: 'none' }).animate({ opacity: 1, left: 0, }, { duration:700, complete: function(){ $(element.el).css({ transition: '' }); if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'drop-right-unwrap': { show: function(element){ var left=parseInt($(element.el).width()/15); $(element.el).wrapInner('
    ').css({ opacity: 1 }); $(element.el).find('> div').css({ opacity: 0 }).animate({ opacity: 1, left: 0, }, { duration:700, complete: function(){ if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'drop-left': { show: function(element){ var right=parseInt($(element.el).width()/15); $(element.el).wrapInner('
    ').css({ opacity: 1 }); $(element.el).find('> div').css({ opacity: 0 }).animate({ opacity: 1, right: 0 }, { duration:700, complete: function(){ $(element.el).html($(element.el).find('> div').html()); if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'drop-bottom': { show: function(element){ var top=parseInt($(element.el).height()/15); $(element.el).wrapInner('
    ').css({ opacity: 1 }); $(element.el).find('> div').css({ opacity: 0 }).animate({ opacity: 1, top: 0 }, { duration:700, complete: function(){ var $div=$(element.el).find('> div'); $(element.el).append($div.find('> *')); $div.remove(); if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'drop-top': { show: function(element){ var step=$(element.el).data('ll-step')||0.07; step=parseFloat(step); var bottom=parseInt($(element.el).height() * step); $(element.el).wrapInner('
    ').css({ opacity: 1 }); $(element.el).find('> div').css({ opacity: 0 }).animate({ opacity: 1, bottom: 0 }, { duration:700, complete: function(){ $(element.el).html($(element.el).find('> div').html()); if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'slide-right': { show: function(element){ if(element.options.firstGroupElement) $(element.el).parent().css({ overflow: 'hidden' }); $(element.el).css({ opacity: 0, position: 'relative', left: '100%' }).animate({left: 0, opacity: 1}, 100).animate({left: -15}, 100).animate({left: 0}, 100, function(){ if(element.options.lastGroupElement) $(element.el).parent().css({ overflow: 'visible' }); if(element.options.queueType=='sync') element.finishAnimation(); }); }}, 'move-up': { show: function(element){ $(element.el).css({ opacity: 0, transform: 'translateY(40px)' }).animate({ opacity: 1, transform: 'translateY(0px)' }, { duration:1000, complete: function(){ if(element.options.queueType=='sync') element.finishAnimation(); }}); }}, 'action': { show: function(element){ var func=$(element.el).data('ll-action-func')||''; if(!func||window[func]==null||window[func]==undefined) return; window[func](element.el); }}, }; function Element(el, options){ this.el=el; this.options={ offset: 1, delay: -1, }; $.extend(this.options, options); if(this.options['delay']==undefined||this.options['delay']==null) this.options['delay']=-1; this.options.queueType=this.options.delay==-1 ? 'sync': 'async'; } function Group(el, options){ this.el=el; this.queue=new Queue(this); this.options={ offset: 0.7, delay: -1, queueType: 'sync', isFirst: false, force: false, firstGroupElement: false, lastGroupElement: false }; $.extend(this.options, options); if(this.options['itemDelay']==undefined||this.options['itemDelay']==null) this.options['itemDelay']=-1; this.options.itemQueueType=this.options.itemDelay==-1 ? 'sync': 'async'; this.options['finishDelay']=this.options['finishDelay']||300; } function Queue(obj){ this.object=obj; this.queue=[]; this.is_exec=false; } function LazyLoading(options){ this.options={ }; $.extend(this.options, options); this.initialize(); } $.fn.reverse=[].reverse; String.prototype.startsWith=function (str){ return this.indexOf(str)==0; }; $.lazyLoading=function(options){ return new LazyLoading(options); } function getOffset(elem){ if(elem.getBoundingClientRect&&window.gemBrowser.platform.name!='ios'){ var bound=elem.getBoundingClientRect(), html=elem.ownerDocument.documentElement, htmlScroll=getScroll(html), elemScrolls=getScrolls(elem), isFixed=(styleString(elem, 'position')=='fixed'); return { x: parseInt(bound.left) + elemScrolls.x + ((isFixed) ? 0:htmlScroll.x) - html.clientLeft, y: parseInt(bound.top) + elemScrolls.y + ((isFixed) ? 0:htmlScroll.y) - html.clientTop };} var element=elem, position={x: 0, y: 0}; if(isBody(elem)) return position; while (element&&!isBody(element)){ position.x +=element.offsetLeft; position.y +=element.offsetTop; if(window.gemBrowser.name=='firefox'){ if(!borderBox(element)){ position.x +=leftBorder(element); position.y +=topBorder(element); } var parent=element.parentNode; if(parent&&styleString(parent, 'overflow')!='visible'){ position.x +=leftBorder(parent); position.y +=topBorder(parent); }}else if(element!=elem&&window.gemBrowser.name=='safari'){ position.x +=leftBorder(element); position.y +=topBorder(element); } element=element.offsetParent; } if(window.gemBrowser.name=='firefox'&&!borderBox(elem)){ position.x -=leftBorder(elem); position.y -=topBorder(elem); } return position; }; function getScroll(elem){ return {x: window.pageXOffset||document.documentElement.scrollLeft, y: window.pageYOffset||document.documentElement.scrollTop};}; function getScrolls(elem){ var element=elem.parentNode, position={x: 0, y: 0}; while (element&&!isBody(element)){ position.x +=element.scrollLeft; position.y +=element.scrollTop; element=element.parentNode; } return position; }; function styleString(element, style){ return $(element).css(style); }; function styleNumber(element, style){ return parseInt(styleString(element, style))||0; }; function borderBox(element){ return styleString(element, '-moz-box-sizing')=='border-box'; }; function topBorder(element){ return styleNumber(element, 'border-top-width'); }; function leftBorder(element){ return styleNumber(element, 'border-left-width'); }; function isBody(element){ return (/^(?:body|html)$/i).test(element.tagName); }; LazyLoading.prototype={ initialize: function(){ this.animated=false; this.groups=[]; this.queue=new Queue(this); this.init=true; this.hasHeaderVisuals=$('.ls-wp-container').size() > 0; $(document).find('.lazy-loading:first').addClass('lazy-loading-first'); $(document).find('.lazy-loading').not('.lazy-loading-not-hide').css({visibility: 'hidden'}); $(document).ready(function(){ self.rebuild(); $(window).resize(function(){ if(self.resizeTimeout){ clearTimeout(self.resizeTimeout); } self.rebuild(); }); }); var self=this; $(window).scroll(function(){ if(!self.animated){ if(self.init) self.buildList(); self.init=false; setTimeout(function(){ self.scrollPageHandler(); }, 100); self.animated=true; }}); $(window).on('lazy-loading-start', function(){ self.rebuild(); }); }, rebuild: function(){ this.buildList(); this.scrollPageHandler(); }, scrollPageHandler: function(){ var self=this; var new_elements=[]; var window_bottom=$(window).scrollTop() + $(window).height(); $.each(this.groups, function(index, group){ if(group.is_visible(window_bottom)){ group.show(); }else{ new_elements.push(group); }}); this.queue.next(); this.groups=new_elements; this.animated=false; }, buildList: function(){ var self=this; this.groups=[]; $(document).find('.lazy-loading').not('.lazy-loading-showed').each(function(){ var group=new Group(this, { offset: $(this).data('ll-offset')||0.7, lazyLoading: self, itemDelay: $(this).data('ll-item-delay'), isFirst: self.hasHeaderVisuals&&$(this).hasClass('lazy-loading-first'), finishDelay: $(this).data('ll-finish-delay'), force: $(this).data('ll-force-start')!=undefined&&$(this).data('ll-force-start')!=null }); var elements=[]; $(this).find('.lazy-loading-item').not('.lazy-loading-showed').each(function(){ var effect=self.getEffect(this); if(effect==''){ $(this).css({ opacity: 1 }); return; } var el_delay=group.options.itemDelay; var element_delay=$(this).data('ll-item-delay'); if(element_delay!=null&&element_delay!=undefined){ el_delay=element_delay; } element=new Element(this, { effect: effect, group: group, delay: el_delay, }); elements.push(element); }); if(elements.length > 0){ group.setElements(elements); self.groups.push(group); }}); }, getEffect: function(element){ return $(element).data('ll-effect')||''; }, finishAnimation: function(){ }}; Group.prototype={ is_visible: function(window_bottom){ if(this.options.force) return true; var position=getOffset(this.el); if((position.y + parseFloat(this.options.offset) * this.el.offsetHeight) <=window_bottom){ return true; } else return false; }, show: function(){ this.options.lazyLoading.queue.add(this); $(this.el).addClass('lazy-loading-showed'); }, setElements: function(elements){ this.elements=elements; }, startAnimation: function(){ var self=this; $(this.el).css({visibility: 'visible'}); $.each(this.elements, function(index, element){ if(self.elements[index].options.effect!='action') if(self.elements[index].options.effect!='clip') $(self.elements[index].el).css({ opacity: 0 }); else $(self.elements[index].el).css({ position: 'relative', transform: 'scale(0)' }); if(index==0) self.elements[index].options.firstGroupElement=true; if(index==self.elements.length - 1){ self.elements[index].options.lastGroupElement=true; self.elements[index].options.queueType='sync'; } self.elements[index].show(); }); if(this.options.isFirst){ setTimeout(function(){ self.queue.next(); }, 500); }else{ this.queue.next(); } setTimeout(function(){ self.finishAnimation(); }, this.options.finishDelay); }, finishAnimation: function(){ this.options.lazyLoading.queue.finishPosition(); }}; Element.prototype={ is_visible: function(window_bottom){ var lazy_effect=lazy_effects[this.options.effect]||{}; var offset=lazy_effect['offset']||this.options.offset; var position=getOffset(this.el); if((position.y + offset * this.el.offsetHeight) <=window_bottom) return true; else return false; }, show: function(){ this.options.group.queue.add(this); $(this.el).addClass('lazy-loading-showed'); }, startAnimation: function(){ var self=this; var lazy_effect=lazy_effects[this.options.effect]||{}; var func=lazy_effect['show']||function(){}; func(this); if(this.options.delay >=0&&this.options.queueType=='async') if(this.options.delay > 0) setTimeout(function(){ self.finishAnimation(); }, this.options.delay); else self.finishAnimation(); }, finishAnimation: function(){ this.options.group.queue.finishPosition(); }}; Queue.prototype={ add: function(obj){ this.queue.push(obj); }, next: function(){ if(this.is_exec||this.queue.length==0) return false; this.is_exec=true; var obj=this.queue.shift(); obj.startAnimation(); }, finishPosition: function(){ this.is_exec=false; if(this.queue.length > 0) this.next(); }};}(jQuery)); (function($, window, document, Math, undefined){ var div=document.createElement("div"), divStyle=div.style, suffix="Transform", testProperties=[ "O" + suffix, "ms" + suffix, "Webkit" + suffix, "Moz" + suffix ], i=testProperties.length, supportProperty, supportMatrixFilter, supportFloat32Array="Float32Array" in window, propertyHook, propertyGet, rMatrix=/Matrix([^)]*)/, rAffine=/^\s*matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*(?:,\s*0(?:px)?\s*){2}\)\s*$/, _transform="transform", _transformOrigin="transformOrigin", _translate="translate", _rotate="rotate", _scale="scale", _skew="skew", _matrix="matrix"; while(i--){ if(testProperties[i] in divStyle){ $.support[_transform]=supportProperty=testProperties[i]; $.support[_transformOrigin]=supportProperty + "Origin"; continue; }} if(!supportProperty){ $.support.matrixFilter=supportMatrixFilter=divStyle.filter===""; } $.cssNumber[_transform]=$.cssNumber[_transformOrigin]=true; if(supportProperty&&supportProperty!=_transform){ $.cssProps[_transform]=supportProperty; $.cssProps[_transformOrigin]=supportProperty + "Origin"; if(supportProperty=="Moz" + suffix){ propertyHook={ get: function(elem, computed){ return (computed ? $.css(elem, supportProperty).split("px").join(""): elem.style[supportProperty] ); }, set: function(elem, value){ elem.style[supportProperty]=/matrix\([^)p]*\)/.test(value) ? value.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/, _matrix+"$1$2px,$3px"): value; }}; }else if(/^1\.[0-5](?:\.|$)/.test($.fn.jquery)){ propertyHook={ get: function(elem, computed){ return (computed ? $.css(elem, supportProperty.replace(/^ms/, "Ms")): elem.style[supportProperty] ); }};} /* TODO: leverage hardware acceleration of 3d transform in Webkit only else if(supportProperty=="Webkit" + suffix&&support3dTransform){ propertyHook={ set: function(elem, value){ elem.style[supportProperty] = value.replace(); }} }*/ }else if(supportMatrixFilter){ propertyHook={ get: function(elem, computed, asArray){ var elemStyle=(computed&&elem.currentStyle ? elem.currentStyle:elem.style), matrix, data; if(elemStyle&&rMatrix.test(elemStyle.filter)){ matrix=RegExp.$1.split(","); matrix=[ matrix[0].split("=")[1], matrix[2].split("=")[1], matrix[1].split("=")[1], matrix[3].split("=")[1] ]; }else{ matrix=[1,0,0,1]; } if(! $.cssHooks[_transformOrigin]){ matrix[4]=elemStyle ? parseInt(elemStyle.left, 10)||0:0; matrix[5]=elemStyle ? parseInt(elemStyle.top, 10)||0:0; }else{ data=$._data(elem, "transformTranslate", undefined); matrix[4]=data ? data[0]:0; matrix[5]=data ? data[1]:0; } return asArray ? matrix:_matrix+"(" + matrix + ")"; }, set: function(elem, value, animate){ var elemStyle=elem.style, currentStyle, Matrix, filter, centerOrigin; if(!animate){ elemStyle.zoom=1; } value=matrix(value); Matrix=[ "Matrix("+ "M11="+value[0], "M12="+value[2], "M21="+value[1], "M22="+value[3], "SizingMethod='auto expand'" ].join(); filter=(currentStyle=elem.currentStyle)&¤tStyle.filter||elemStyle.filter||""; elemStyle.filter=rMatrix.test(filter) ? filter.replace(rMatrix, Matrix) : filter + " progid:DXImageTransform.Microsoft." + Matrix + ")"; if(! $.cssHooks[_transformOrigin]){ if((centerOrigin=$.transform.centerOrigin)){ elemStyle[centerOrigin=="margin" ? "marginLeft":"left"]=-(elem.offsetWidth/2) + (elem.clientWidth/2) + "px"; elemStyle[centerOrigin=="margin" ? "marginTop":"top"]=-(elem.offsetHeight/2) + (elem.clientHeight/2) + "px"; } elemStyle.left=value[4] + "px"; elemStyle.top=value[5] + "px"; }else{ $.cssHooks[_transformOrigin].set(elem, value); }} };} if(propertyHook){ $.cssHooks[_transform]=propertyHook; } propertyGet=propertyHook&&propertyHook.get||$.css; $.fx.step.transform=function(fx){ var elem=fx.elem, start=fx.start, end=fx.end, pos=fx.pos, transform="", precision=1E5, i, startVal, endVal, unit; if(!start||typeof start==="string"){ if(!start){ start=propertyGet(elem, supportProperty); } if(supportMatrixFilter){ elem.style.zoom=1; } end=end.split("+=").join(start); $.extend(fx, interpolationList(start, end)); start=fx.start; end=fx.end; } i=start.length; while(i--){ startVal=start[i]; endVal=end[i]; unit=+false; switch(startVal[0]){ case _translate: unit="px"; case _scale: unit||(unit=""); transform=startVal[0] + "(" + Math.round((startVal[1][0] + (endVal[1][0] - startVal[1][0]) * pos) * precision) / precision + unit +","+ Math.round((startVal[1][1] + (endVal[1][1] - startVal[1][1]) * pos) * precision) / precision + unit + ")"+ transform; break; case _skew + "X": case _skew + "Y": case _rotate: transform=startVal[0] + "(" + Math.round((startVal[1] + (endVal[1] - startVal[1]) * pos) * precision) / precision +"rad)"+ transform; break; }} fx.origin&&(transform=fx.origin + transform); propertyHook&&propertyHook.set ? propertyHook.set(elem, transform, +true): elem.style[supportProperty]=transform; }; function matrix(transform){ transform=transform.split(")"); var trim=$.trim , i=-1 , l=transform.length -1 , split, prop, val , prev=supportFloat32Array ? new Float32Array(6):[] , curr=supportFloat32Array ? new Float32Array(6):[] , rslt=supportFloat32Array ? new Float32Array(6):[1,0,0,1,0,0] ; prev[0]=prev[3]=rslt[0]=rslt[3]=1; prev[1]=prev[2]=prev[4]=prev[5]=0; while ( ++i < l){ split=transform[i].split("("); prop=trim(split[0]); val=split[1]; curr[0]=curr[3]=1; curr[1]=curr[2]=curr[4]=curr[5]=0; switch (prop){ case _translate+"X": curr[4]=parseInt(val, 10); break; case _translate+"Y": curr[5]=parseInt(val, 10); break; case _translate: val=val.split(","); curr[4]=parseInt(val[0], 10); curr[5]=parseInt(val[1]||0, 10); break; case _rotate: val=toRadian(val); curr[0]=Math.cos(val); curr[1]=Math.sin(val); curr[2]=-Math.sin(val); curr[3]=Math.cos(val); break; case _scale+"X": curr[0]=+val; break; case _scale+"Y": curr[3]=val; break; case _scale: val=val.split(","); curr[0]=val[0]; curr[3]=val.length>1 ? val[1]:val[0]; break; case _skew+"X": curr[2]=Math.tan(toRadian(val)); break; case _skew+"Y": curr[1]=Math.tan(toRadian(val)); break; case _matrix: val=val.split(","); curr[0]=val[0]; curr[1]=val[1]; curr[2]=val[2]; curr[3]=val[3]; curr[4]=parseInt(val[4], 10); curr[5]=parseInt(val[5], 10); break; } rslt[0]=prev[0] * curr[0] + prev[2] * curr[1]; rslt[1]=prev[1] * curr[0] + prev[3] * curr[1]; rslt[2]=prev[0] * curr[2] + prev[2] * curr[3]; rslt[3]=prev[1] * curr[2] + prev[3] * curr[3]; rslt[4]=prev[0] * curr[4] + prev[2] * curr[5] + prev[4]; rslt[5]=prev[1] * curr[4] + prev[3] * curr[5] + prev[5]; prev=[rslt[0],rslt[1],rslt[2],rslt[3],rslt[4],rslt[5]]; } return rslt; } function unmatrix(matrix){ var scaleX , scaleY , skew , A=matrix[0] , B=matrix[1] , C=matrix[2] , D=matrix[3] ; if(A * D - B * C){ scaleX=Math.sqrt(A * A + B * B); A /=scaleX; B /=scaleX; skew=A * C + B * D; C -=A * skew; D -=B * skew; scaleY=Math.sqrt(C * C + D * D); C /=scaleY; D /=scaleY; skew /=scaleY; if(A * D < B * C){ A=-A; B=-B; skew=-skew; scaleX=-scaleX; }}else{ scaleX=scaleY=skew=0; } return [ [_translate, [+matrix[4], +matrix[5]]], [_rotate, Math.atan2(B, A)], [_skew + "X", Math.atan(skew)], [_scale, [scaleX, scaleY]] ]; } function interpolationList(start, end){ var list={ start: [], end: [] }, i=-1, l, currStart, currEnd, currType; (start=="none"||isAffine(start))&&(start=""); (end=="none"||isAffine(end))&&(end=""); if(start&&end&&!end.indexOf("matrix")&&toArray(start).join()==toArray(end.split(")")[0]).join()){ list.origin=start; start=""; end=end.slice(end.indexOf(")") +1); } if(!start&&!end){ return; } if(!start||!end||functionList(start)==functionList(end)){ start&&(start=start.split(")"))&&(l=start.length); end&&(end=end.split(")"))&&(l=end.length); while ( ++i < l-1){ start[i]&&(currStart=start[i].split("(")); end[i]&&(currEnd=end[i].split("(")); currType=$.trim(( currStart||currEnd)[0]); append(list.start, parseFunction(currType, currStart ? currStart[1]:0)); append(list.end, parseFunction(currType, currEnd ? currEnd[1]:0)); }}else{ list.start=unmatrix(matrix(start)); list.end=unmatrix(matrix(end)) } return list; } function parseFunction(type, value){ var defaultValue=+(!type.indexOf(_scale)), scaleX, cat=type.replace(/e[XY]/, "e"); switch(type){ case _translate+"Y": case _scale+"Y": value=[ defaultValue, value ? parseFloat(value): defaultValue ]; break; case _translate+"X": case _translate: case _scale+"X": scaleX=1; case _scale: value=value ? (value=value.split(","))&&[ parseFloat(value[0]), parseFloat(value.length>1 ? value[1]:type==_scale ? scaleX||value[0]:defaultValue+"") ]: [defaultValue, defaultValue]; break; case _skew+"X": case _skew+"Y": case _rotate: value=value ? toRadian(value):0; break; case _matrix: return unmatrix(value ? toArray(value):[1,0,0,1,0,0]); break; } return [[ cat, value ]]; } function isAffine(matrix){ return rAffine.test(matrix); } function functionList(transform){ return transform.replace(/(?:\([^)]*\))|\s/g, ""); } function append(arr1, arr2, value){ while(value=arr2.shift()){ arr1.push(value); }} function toRadian(value){ return ~value.indexOf("deg") ? parseInt(value,10) * (Math.PI * 2 / 360): ~value.indexOf("grad") ? parseInt(value,10) * (Math.PI/200): parseFloat(value); } function toArray(matrix){ matrix=/([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(matrix); return [matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6]]; } $.transform={ centerOrigin: "margin" };})(jQuery, window, document, Math); !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b="ui-effects-",c=a; return a.effects={effect:{}},function(a,b){function c(a,b,c){var d=l[b.type]||{};return null==a?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max")[0],o=a.each;n.style.cssText="background-color:rgba(1,1,1,.5)",m.rgba=n.style.backgroundColor.indexOf("rgba")>-1,o(k,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),j.fn=a.extend(j.prototype,{parse:function(e,g,h,i){if(e===b)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=a(e).css(g),g=b);var l=this,m=a.type(e),n=this._rgba=[];return g!==b&&(e=[e,g,h,i],m="array"),"string"===m?this.parse(d(e)||f._default):"array"===m?(o(k.rgba.props,function(a,b){n[b.idx]=c(e[b.idx],b)}),this):"object"===m?(e instanceof j?o(k,function(a,b){e[b.cache]&&(l[b.cache]=e[b.cache].slice())}):o(k,function(b,d){var f=d.cache;o(d.props,function(a,b){if(!l[f]&&d.to){if("alpha"===a||null==e[a])return;l[f]=d.to(l._rgba)}l[f][b.idx]=c(e[a],b,!0)}),l[f]&&a.inArray(null,l[f].slice(0,3))<0&&(l[f][3]=1,d.from&&(l._rgba=d.from(l[f])))}),this):void 0},is:function(a){var b=j(a),c=!0,d=this;return o(k,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],o(e.props,function(a,b){if(null!=g[b.idx])return c=g[b.idx]===f[b.idx]})),c}),c},_space:function(){var a=[],b=this;return o(k,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var d=j(a),e=d._space(),f=k[e],g=0===this.alpha()?j("transparent"):this,h=g[f.cache]||f.to(g._rgba),i=h.slice();return d=d[f.cache],o(f.props,function(a,e){var f=e.idx,g=h[f],j=d[f],k=l[e.type]||{};null!==j&&(null===g?i[f]=j:(k.mod&&(j-g>k.mod/2?g+=k.mod:g-j>k.mod/2&&(g-=k.mod)),i[f]=c((j-g)*b+g,e)))}),this[e](i)},blend:function(b){if(1===this._rgba[3])return this;var c=this._rgba.slice(),d=c.pop(),e=j(b)._rgba;return j(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return null==a?b>2?1:0:a});return 1===c[3]&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return null==a&&(a=b>2?1:0),b&&b<3&&(a=Math.round(100*a)+"%"),a});return 1===c[3]&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(255*d)),"#"+a.map(c,function(a){return a=(a||0).toString(16),1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),j.fn.parse.prototype=j.fn,k.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b,c,d=a[0]/255,e=a[1]/255,f=a[2]/255,g=a[3],h=Math.max(d,e,f),i=Math.min(d,e,f),j=h-i,k=h+i,l=.5*k;return b=i===h?0:d===h?60*(e-f)/j+360:e===h?60*(f-d)/j+120:60*(d-e)/j+240,c=0===j?0:l<=.5?j/k:j/(2-k),[Math.round(b)%360,c,l,null==g?1:g]},k.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],f=a[3],g=d<=.5?d*(1+c):d+c-d*c,h=2*d-g;return[Math.round(255*e(h,g,b+1/3)),Math.round(255*e(h,g,b)),Math.round(255*e(h,g,b-1/3)),f]},o(k,function(d,e){var f=e.props,g=e.cache,i=e.to,k=e.from;j.fn[d]=function(d){if(i&&!this[g]&&(this[g]=i(this._rgba)),d===b)return this[g].slice();var e,h=a.type(d),l="array"===h||"object"===h?d:arguments,m=this[g].slice();return o(f,function(a,b){var d=l["object"===h?a:b.idx];null==d&&(d=m[b.idx]),m[b.idx]=c(d,b)}),k?(e=j(k(m)),e[g]=m,e):j(m)},o(f,function(b,c){j.fn[b]||(j.fn[b]=function(e){var f,g=a.type(e),i="alpha"===b?this._hsla?"hsla":"rgba":d,j=this[i](),k=j[c.idx];return"undefined"===g?k:("function"===g&&(e=e.call(this,k),g=a.type(e)),null==e&&c.empty?this:("string"===g&&(f=h.exec(e),f&&(e=k+parseFloat(f[2])*("+"===f[1]?1:-1))),j[c.idx]=e,this[i](j)))})})}),j.hook=function(b){var c=b.split(" ");o(c,function(b,c){a.cssHooks[c]={set:function(b,e){var f,g,h="";if("transparent"!==e&&("string"!==a.type(e)||(f=d(e)))){if(e=j(f||e),!m.rgba&&1!==e._rgba[3]){for(g="backgroundColor"===c?b.parentNode:b;(""===h||"transparent"===h)&&g&&g.style;)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(i){}e=e.blend(h&&"transparent"!==h?h:"_default")}e=e.toRgbaString()}try{b.style[c]=e}catch(i){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=j(b.elem,c),b.end=j(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},j.hook(g),a.cssHooks.borderColor={expand:function(a){var b={};return o(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},f=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(c),function(){function b(b){var c,d,e=b.ownerDocument.defaultView?b.ownerDocument.defaultView.getComputedStyle(b,null):b.currentStyle,f={};if(e&&e.length&&e[0]&&e[e[0]])for(d=e.length;d--;)c=e[d],"string"==typeof e[c]&&(f[a.camelCase(c)]=e[c]);else for(c in e)"string"==typeof e[c]&&(f[c]=e[c]);return f}function d(b,c){var d,e,g={};for(d in c)e=c[d],b[d]!==e&&(f[d]||!a.fx.step[d]&&isNaN(parseFloat(e))||(g[d]=e));return g}var e=["add","remove","toggle"],f={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(b,d){a.fx.step[d]=function(a){("none"!==a.end&&!a.setAttr||1===a.pos&&!a.setAttr)&&(c.style(a.elem,d,a.end),a.setAttr=!0)}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a.effects.animateClass=function(c,f,g,h){var i=a.speed(f,g,h);return this.queue(function(){var f,g=a(this),h=g.attr("class")||"",j=i.children?g.find("*").addBack():g;j=j.map(function(){var c=a(this);return{el:c,start:b(this)}}),f=function(){a.each(e,function(a,b){c[b]&&g[b+"Class"](c[b])})},f(),j=j.map(function(){return this.end=b(this.el[0]),this.diff=d(this.start,this.end),this}),g.attr("class",h),j=j.map(function(){var b=this,c=a.Deferred(),d=a.extend({},i,{queue:!1,complete:function(){c.resolve(b)}});return this.el.animate(this.diff,d),c.promise()}),a.when.apply(a,j.get()).done(function(){f(),a.each(arguments,function(){var b=this.el;a.each(this.diff,function(a){b.css(a,"")})}),i.complete.call(g[0])})})},a.fn.extend({addClass:function(b){return function(c,d,e,f){return d?a.effects.animateClass.call(this,{add:c},d,e,f):b.apply(this,arguments)}}(a.fn.addClass),removeClass:function(b){return function(c,d,e,f){return arguments.length>1?a.effects.animateClass.call(this,{remove:c},d,e,f):b.apply(this,arguments)}}(a.fn.removeClass),toggleClass:function(b){return function(c,d,e,f,g){return"boolean"==typeof d||void 0===d?e?a.effects.animateClass.call(this,d?{add:c}:{remove:c},e,f,g):b.apply(this,arguments):a.effects.animateClass.call(this,{toggle:c},d,e,f)}}(a.fn.toggleClass),switchClass:function(b,c,d,e,f){return a.effects.animateClass.call(this,{add:c,remove:b},d,e,f)}})}(),function(){function c(b,c,d,e){return a.isPlainObject(b)&&(c=b,b=b.effect),b={effect:b},null==c&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"==typeof c||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b}function d(b){return!(b&&"number"!=typeof b&&!a.fx.speeds[b])||("string"==typeof b&&!a.effects.effect[b]||(!!a.isFunction(b)||"object"==typeof b&&!b.effect))}a.extend(a.effects,{version:"1.11.4",save:function(a,c){for(var d=0;d").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;try{f.id}catch(g){f=document.body}return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).focus(),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).focus()),b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(){function b(b){function c(){a.isFunction(f)&&f.call(e[0]),a.isFunction(b)&&b()}var e=a(this),f=d.complete,h=d.mode;(e.is(":hidden")?"hide"===h:"show"===h)?(e[h](),c()):g.call(e[0],d,c)}var d=c.apply(this,arguments),e=d.mode,f=d.queue,g=a.effects.effect[d.effect];return a.fx.off||!g?e?this[e](d.duration,d.complete):this.each(function(){d.complete&&d.complete.call(this)}):f===!1?this.each(b):this.queue(f||"fx",b)},show:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="show",this.effect.call(this,e)}}(a.fn.show),hide:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)}}(a.fn.hide),toggle:function(a){return function(b){if(d(b)||"boolean"==typeof b)return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="toggle",this.effect.call(this,e)}}(a.fn.toggle),cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}})}(),function(){var b={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,c){b[c]=function(b){return Math.pow(b,a+2)}}),a.extend(b,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),a.each(b,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(2*a)/2:1-c(a*-2+2)/2}})}(),a.effects}); !function(a){"function"==typeof define&&define.amd?define(["jquery","./effect"],a):a(jQuery)}(function(a){return a.effects.effect.drop=function(b,c){var d,e=a(this),f=["position","top","bottom","left","right","opacity","height","width"],g=a.effects.setMode(e,b.mode||"hide"),h="show"===g,i=b.direction||"left",j="up"===i||"down"===i?"top":"left",k="up"===i||"left"===i?"pos":"neg",l={opacity:h?1:0};a.effects.save(e,f),e.show(),a.effects.createWrapper(e),d=b.distance||e["top"===j?"outerHeight":"outerWidth"](!0)/2,h&&e.css("opacity",0).css(j,"pos"===k?-d:d),l[j]=(h?"pos"===k?"+=":"-=":"pos"===k?"-=":"+=")+d,e.animate(l,{queue:!1,duration:b.duration,easing:b.easing,complete:function(){"hide"===g&&e.hide(),a.effects.restore(e,f),a.effects.removeWrapper(e),c()}})}}); (function(){ var COUNT_FRAMERATE, COUNT_MS_PER_FRAME, DIGIT_FORMAT, DIGIT_HTML, DIGIT_SPEEDBOOST, DURATION, FORMAT_MARK_HTML, FORMAT_PARSER, FRAMERATE, FRAMES_PER_VALUE, MS_PER_FRAME, MutationObserver, Odometer, RIBBON_HTML, TRANSITION_END_EVENTS, TRANSITION_SUPPORT, VALUE_HTML, addClass, createFromHTML, fractionalPart, now, removeClass, requestAnimationFrame, round, transitionCheckStyles, trigger, truncate, wrapJQuery, _jQueryWrapped, _old, _ref, _ref1, __slice=[].slice; VALUE_HTML=''; RIBBON_HTML='' + VALUE_HTML + ''; DIGIT_HTML='8' + RIBBON_HTML + ''; FORMAT_MARK_HTML=''; DIGIT_FORMAT='(,ddd).dd'; FORMAT_PARSER=/^\(?([^)]*)\)?(?:(.)(d+))?$/; FRAMERATE=30; DURATION=2000; COUNT_FRAMERATE=20; FRAMES_PER_VALUE=2; DIGIT_SPEEDBOOST=.5; MS_PER_FRAME=1000 / FRAMERATE; COUNT_MS_PER_FRAME=1000 / COUNT_FRAMERATE; TRANSITION_END_EVENTS='transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd'; transitionCheckStyles=document.createElement('div').style; TRANSITION_SUPPORT=(transitionCheckStyles.transition!=null)||(transitionCheckStyles.webkitTransition!=null)||(transitionCheckStyles.mozTransition!=null)||(transitionCheckStyles.oTransition!=null); requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame; MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver; createFromHTML=function(html){ var el; el=document.createElement('div'); el.innerHTML=html; return el.children[0]; }; removeClass=function(el, name){ return el.className=el.className.replace(new RegExp("(^|)" + (name.split(' ').join('|')) + "(|$)", 'gi'), ' '); }; addClass=function(el, name){ removeClass(el, name); return el.className +=" " + name; }; trigger=function(el, name){ var evt; if(document.createEvent!=null){ evt=document.createEvent('HTMLEvents'); evt.initEvent(name, true, true); return el.dispatchEvent(evt); }}; now=function(){ var _ref, _ref1; return (_ref=(_ref1=window.performance)!=null ? typeof _ref1.now==="function" ? _ref1.now():void 0:void 0)!=null ? _ref:+(new Date); }; round=function(val, precision){ if(precision==null){ precision=0; } if(!precision){ return Math.round(val); } val *=Math.pow(10, precision); val +=0.5; val=Math.floor(val); return val /=Math.pow(10, precision); }; truncate=function(val){ if(val < 0){ return Math.ceil(val); }else{ return Math.floor(val); }}; fractionalPart=function(val){ return val - round(val); }; _jQueryWrapped=false; (wrapJQuery=function(){ var property, _i, _len, _ref, _results; if(_jQueryWrapped){ return; } if(window.jQuery!=null){ _jQueryWrapped=true; _ref=['html', 'text']; _results=[]; for (_i=0, _len=_ref.length; _i < _len; _i++){ property=_ref[_i]; _results.push((function(property){ var old; old=window.jQuery.fn[property]; return window.jQuery.fn[property]=function(val){ var _ref1; if((val==null)||(((_ref1=this[0])!=null ? _ref1.odometer:void 0)==null)){ return old.apply(this, arguments); } return this[0].odometer.update(val); };})(property)); } return _results; }})(); setTimeout(wrapJQuery, 0); Odometer=(function(){ function Odometer(options){ var e, k, property, v, _base, _i, _len, _ref, _ref1, _ref2, _this=this; this.options=options; this.el=this.options.el; if(this.el.odometer!=null){ return this.el.odometer; } this.el.odometer=this; _ref=Odometer.options; for (k in _ref){ v=_ref[k]; if(this.options[k]==null){ this.options[k]=v; }} if((_base=this.options).duration==null){ _base.duration=DURATION; } this.MAX_VALUES=((this.options.duration / MS_PER_FRAME) / FRAMES_PER_VALUE) | 0; this.resetFormat(); this.value=this.cleanValue((_ref1=this.options.value)!=null ? _ref1:''); this.renderInside(); this.render(); try { _ref2=['innerHTML', 'innerText', 'textContent']; for (_i=0, _len=_ref2.length; _i < _len; _i++){ property=_ref2[_i]; if(this.el[property]!=null){ (function(property){ return Object.defineProperty(_this.el, property, { get: function(){ var _ref3; if(property==='innerHTML'){ return _this.inside.outerHTML; }else{ return (_ref3=_this.inside.innerText)!=null ? _ref3:_this.inside.textContent; }}, set: function(val){ return _this.update(val); }}); })(property); }} } catch (_error){ e=_error; this.watchForMutations(); } this; } Odometer.prototype.renderInside=function(){ this.inside=document.createElement('div'); this.inside.className='odometer-inside'; this.el.innerHTML=''; return this.el.appendChild(this.inside); }; Odometer.prototype.watchForMutations=function(){ var e, _this=this; if(MutationObserver==null){ return; } try { if(this.observer==null){ this.observer=new MutationObserver(function(mutations){ var newVal; newVal=_this.el.innerText; _this.renderInside(); _this.render(_this.value); return _this.update(newVal); }); } this.watchMutations=true; return this.startWatchingMutations(); } catch (_error){ e=_error; }}; Odometer.prototype.startWatchingMutations=function(){ if(this.watchMutations){ return this.observer.observe(this.el, { childList: true }); }}; Odometer.prototype.stopWatchingMutations=function(){ var _ref; return (_ref=this.observer)!=null ? _ref.disconnect():void 0; }; Odometer.prototype.cleanValue=function(val){ var _ref; if(typeof val==='string'){ val=val.replace((_ref=this.format.radix)!=null ? _ref:'.', ''); val=val.replace(/[.,]/g, ''); val=val.replace('', '.'); val=parseFloat(val, 10)||0; } return round(val, this.format.precision); }; Odometer.prototype.bindTransitionEnd=function(){ var event, renderEnqueued, _i, _len, _ref, _results, _this=this; if(this.transitionEndBound){ return; } this.transitionEndBound=true; renderEnqueued=false; _ref=TRANSITION_END_EVENTS.split(' '); _results=[]; for (_i=0, _len=_ref.length; _i < _len; _i++){ event=_ref[_i]; _results.push(this.el.addEventListener(event, function(){ if(renderEnqueued){ return true; } renderEnqueued=true; setTimeout(function(){ _this.render(); renderEnqueued=false; return trigger(_this.el, 'odometerdone'); }, 0); return true; }, false)); } return _results; }; Odometer.prototype.resetFormat=function(){ var format, fractional, parsed, precision, radix, repeating, _ref, _ref1; format=(_ref=this.options.format)!=null ? _ref:DIGIT_FORMAT; format||(format='d'); parsed=FORMAT_PARSER.exec(format); if(!parsed){ throw new Error("Odometer: Unparsable digit format"); } _ref1=parsed.slice(1, 4), repeating=_ref1[0], radix=_ref1[1], fractional=_ref1[2]; precision=(fractional!=null ? fractional.length:void 0)||0; return this.format={ repeating: repeating, radix: radix, precision: precision };}; Odometer.prototype.render=function(value){ var classes, cls, digit, match, newClasses, theme, wholePart, _i, _j, _len, _len1, _ref; if(value==null){ value=this.value; } this.stopWatchingMutations(); this.resetFormat(); this.inside.innerHTML=''; theme=this.options.theme; classes=this.el.className.split(' '); newClasses=[]; for (_i=0, _len=classes.length; _i < _len; _i++){ cls=classes[_i]; if(!cls.length){ continue; } if(match=/^odometer-theme-(.+)$/.exec(cls)){ theme=match[1]; continue; } if(/^odometer(-|$)/.test(cls)){ continue; } newClasses.push(cls); } newClasses.push('odometer'); if(!TRANSITION_SUPPORT){ newClasses.push('odometer-no-transitions'); } if(theme){ newClasses.push("odometer-theme-" + theme); }else{ newClasses.push("odometer-auto-theme"); } this.el.className=newClasses.join(' '); this.ribbons={}; this.digits=[]; wholePart = !this.format.precision||!fractionalPart(value)||false; _ref=value.toString().split('').reverse(); for (_j=0, _len1=_ref.length; _j < _len1; _j++){ digit=_ref[_j]; if(digit==='.'){ wholePart=true; } this.addDigit(digit, wholePart); } return this.startWatchingMutations(); }; Odometer.prototype.update=function(newValue){ var diff, _this=this; newValue=this.cleanValue(newValue); if(!(diff=newValue - this.value)){ return; } removeClass(this.el, 'odometer-animating-up odometer-animating-down odometer-animating'); if(diff > 0){ addClass(this.el, 'odometer-animating-up'); }else{ addClass(this.el, 'odometer-animating-down'); } this.stopWatchingMutations(); this.animate(newValue); this.startWatchingMutations(); setTimeout(function(){ _this.el.offsetHeight; return addClass(_this.el, 'odometer-animating'); }, 0); return this.value=newValue; }; Odometer.prototype.renderDigit=function(){ return createFromHTML(DIGIT_HTML); }; Odometer.prototype.insertDigit=function(digit, before){ if(before!=null){ return this.inside.insertBefore(digit, before); }else if(!this.inside.children.length){ return this.inside.appendChild(digit); }else{ return this.inside.insertBefore(digit, this.inside.children[0]); }}; Odometer.prototype.addSpacer=function(chr, before, extraClasses){ var spacer; spacer=createFromHTML(FORMAT_MARK_HTML); spacer.innerHTML=chr; if(extraClasses){ addClass(spacer, extraClasses); } return this.insertDigit(spacer, before); }; Odometer.prototype.addDigit=function(value, repeating){ var chr, digit, resetted, _ref; if(repeating==null){ repeating=true; } if(value==='-'){ return this.addSpacer(value, null, 'odometer-negation-mark'); } if(value==='.'){ return this.addSpacer((_ref=this.format.radix)!=null ? _ref:'.', null, 'odometer-radix-mark'); } if(repeating){ resetted=false; while (true){ if(!this.format.repeating.length){ if(resetted){ throw new Error("Bad odometer format without digits"); } this.resetFormat(); resetted=true; } chr=this.format.repeating[this.format.repeating.length - 1]; this.format.repeating=this.format.repeating.substring(0, this.format.repeating.length - 1); if(chr==='d'){ break; } this.addSpacer(chr); }} digit=this.renderDigit(); digit.querySelector('.odometer-value').innerHTML=value; this.digits.push(digit); return this.insertDigit(digit); }; Odometer.prototype.animate=function(newValue){ if(!TRANSITION_SUPPORT||this.options.animation==='count'){ return this.animateCount(newValue); }else{ return this.animateSlide(newValue); }}; Odometer.prototype.animateCount=function(newValue){ var cur, diff, last, start, tick, _this=this; if(!(diff=+newValue - this.value)){ return; } start=last=now(); cur=this.value; return (tick=function(){ var delta, dist, fraction; if((now() - start) > _this.options.duration){ _this.value=newValue; _this.render(); trigger(_this.el, 'odometerdone'); return; } delta=now() - last; if(delta > COUNT_MS_PER_FRAME){ last=now(); fraction=delta / _this.options.duration; dist=diff * fraction; cur +=dist; _this.render(Math.round(cur)); } if(requestAnimationFrame!=null){ return requestAnimationFrame(tick); }else{ return setTimeout(tick, COUNT_MS_PER_FRAME); }})(); }; Odometer.prototype.getDigitCount=function(){ var i, max, value, values, _i, _len; values=1 <=arguments.length ? __slice.call(arguments, 0):[]; for (i=_i=0, _len=values.length; _i < _len; i=++_i){ value=values[i]; values[i]=Math.abs(value); } max=Math.max.apply(Math, values); return Math.ceil(Math.log(max + 1) / Math.log(10)); }; Odometer.prototype.getFractionalDigitCount=function(){ var i, parser, parts, value, values, _i, _len; values=1 <=arguments.length ? __slice.call(arguments, 0):[]; parser=/^\-?\d*\.(\d*?)0*$/; for (i=_i=0, _len=values.length; _i < _len; i=++_i){ value=values[i]; values[i]=value.toString(); parts=parser.exec(values[i]); if(parts==null){ values[i]=0; }else{ values[i]=parts[1].length; }} return Math.max.apply(Math, values); }; Odometer.prototype.resetDigits=function(){ this.digits=[]; this.ribbons=[]; this.inside.innerHTML=''; return this.resetFormat(); }; Odometer.prototype.animateSlide=function(newValue){ var boosted, cur, diff, digitCount, digits, dist, end, fractionalCount, frame, frames, i, incr, j, mark, numEl, oldValue, start, _base, _i, _j, _k, _l, _len, _len1, _len2, _m, _ref, _results; oldValue=this.value; fractionalCount=this.getFractionalDigitCount(oldValue, newValue); if(fractionalCount){ newValue=newValue * Math.pow(10, fractionalCount); oldValue=oldValue * Math.pow(10, fractionalCount); } if(!(diff=newValue - oldValue)){ return; } this.bindTransitionEnd(); digitCount=this.getDigitCount(oldValue, newValue); digits=[]; boosted=0; for (i=_i=0; 0 <=digitCount ? _i < digitCount:_i > digitCount; i=0 <=digitCount ? ++_i:--_i){ start=truncate(oldValue / Math.pow(10, digitCount - i - 1)); end=truncate(newValue / Math.pow(10, digitCount - i - 1)); dist=end - start; if(Math.abs(dist) > this.MAX_VALUES){ frames=[]; incr=dist / (this.MAX_VALUES + this.MAX_VALUES * boosted * DIGIT_SPEEDBOOST); cur=start; while ((dist > 0&&cur < end)||(dist < 0&&cur > end)){ frames.push(Math.round(cur)); cur +=incr; } if(frames[frames.length - 1]!==end){ frames.push(end); } boosted++; }else{ frames=(function(){ _results=[]; for (var _j=start; start <=end ? _j <=end:_j >=end; start <=end ? _j++:_j--){ _results.push(_j); } return _results; }).apply(this); } for (i=_k=0, _len=frames.length; _k < _len; i=++_k){ frame=frames[i]; frames[i]=Math.abs(frame % 10); } digits.push(frames); } this.resetDigits(); _ref=digits.reverse(); for (i=_l=0, _len1=_ref.length; _l < _len1; i=++_l){ frames=_ref[i]; if(!this.digits[i]){ this.addDigit(' ', i >=fractionalCount); } if((_base=this.ribbons)[i]==null){ _base[i]=this.digits[i].querySelector('.odometer-ribbon-inner'); } this.ribbons[i].innerHTML=''; if(diff < 0){ frames=frames.reverse(); } for (j=_m=0, _len2=frames.length; _m < _len2; j=++_m){ frame=frames[j]; numEl=document.createElement('div'); numEl.className='odometer-value'; numEl.innerHTML=frame; this.ribbons[i].appendChild(numEl); if(j===frames.length - 1){ addClass(numEl, 'odometer-last-value'); } if(j===0){ addClass(numEl, 'odometer-first-value'); }} } if(start < 0){ this.addDigit('-'); } mark=this.inside.querySelector('.odometer-radix-mark'); if(mark!=null){ mark.parent.removeChild(mark); } if(fractionalCount){ return this.addSpacer(this.format.radix, this.digits[fractionalCount - 1], 'odometer-radix-mark'); }}; return Odometer; })(); Odometer.options=(_ref=window.odometerOptions)!=null ? _ref:{}; setTimeout(function(){ var k, v, _base, _ref1, _results; if(window.odometerOptions){ _ref1=window.odometerOptions; _results=[]; for (k in _ref1){ v=_ref1[k]; _results.push((_base=Odometer.options)[k]!=null ? (_base=Odometer.options)[k]:_base[k]=v); } return _results; }}, 0); Odometer.init=function(){ var el, elements, _i, _len, _ref1, _results; if(document.querySelectorAll==null){ return; } elements=document.querySelectorAll(Odometer.options.selector||'.odometer'); _results=[]; for (_i=0, _len=elements.length; _i < _len; _i++){ el=elements[_i]; _results.push(el.odometer=new Odometer({ el: el, value: (_ref1=el.innerText)!=null ? _ref1:el.textContent })); } return _results; }; if((((_ref1=document.documentElement)!=null ? _ref1.doScroll:void 0)!=null)&&(document.createEventObject!=null)){ _old=document.onreadystatechange; document.onreadystatechange=function(){ if(document.readyState==='complete'&&Odometer.options.auto!==false){ Odometer.init(); } return _old!=null ? _old.apply(this, arguments):void 0; };}else{ document.addEventListener('DOMContentLoaded', function(){ if(Odometer.options.auto!==false){ return Odometer.init(); }}, false); } if(typeof define==='function'&&define.amd){ define(['jquery'], function(){ return Odometer; }); }else if(typeof exports===!'undefined'){ module.exports=Odometer; }else{ window.Odometer=Odometer; }}).call(this); (function ($){ function getScrollY(elem){ return window.pageYOffset||document.documentElement.scrollTop; } function Sticky(el, options){ var self=this; this.el=el; this.$el=$(el); this.options={ }; $.extend(this.options, options); self.init(); } $.fn.scSticky=function(options){ $(this).each(function(){ return new Sticky(this, options); }); } Sticky.prototype={ init: function(){ var self=this; this.$wrapper=false; this.$parent=this.getParent(); $(window).scroll(function(){ if(self.useSticky()){ self.wrap(); self.scroll(); }else{ self.unwrap(); }}); $(window).resize(function(){ if(self.useSticky()){ self.wrap(); self.scroll(); }else{ self.unwrap(); }}); }, wrap: function(){ if(!this.$wrapper) this.$wrapper=this.$el.wrap('
    ').parent(); this.$wrapper.attr('class', this.$el.attr('class')).addClass('gem-sticky-block').css({ padding: 0, height: this.$el.outerHeight() }); this.$el.css({ width: this.$wrapper.outerWidth(), margin: 0 }); }, getParent: function(){ return this.$el.parent(); }, useSticky: function(){ var is_sidebar=true; if(this.$el.hasClass('sidebar')){ if(this.$wrapper){ if(this.$wrapper.outerHeight() > this.$wrapper.siblings('.panel-center:first').outerHeight()) is_sidebar=false; }else{ if(this.$el.outerHeight() > this.$el.siblings('.panel-center:first').outerHeight()) is_sidebar=false; }} return $(window).width() > 1000&&is_sidebar; }, unwrap: function(){ if(this.$el.parent().is('.gem-sticky-block')){ this.$el.unwrap(); this.$wrapper=false; } this.$el.css({ width: "", top: "", bottom: "", margin: "" }); }, scroll: function(){ var top_offset=parseInt($('html').css('margin-top')); var $header=$('#site-header'); if($header.hasClass('fixed')){ top_offset +=$header.outerHeight(); } var scroll=getScrollY(); var offset=this.$wrapper.offset(); var parent_offset=this.$parent.offset(); var parent_bottom=parent_offset.top + this.$parent.outerHeight() - scroll; var bottom=$(window).height() - parent_bottom; if((top_offset + this.$el.outerHeight()) >=parent_bottom){ this.$el.addClass('sticky-fixed').css({ top: "", bottom: bottom, left: offset.left }); return; } if((scroll + top_offset) > offset.top){ this.$el.addClass('sticky-fixed').css({ top: top_offset, bottom: "", left: offset.left }); }else{ this.$el.removeClass('sticky-fixed').css({ top: "", bottom: "", left: "" }); }} };}(jQuery)); (function($){ $.fn.thegemPreloader=function(callback){ $(this).each(function(){ var $el=$(this); if(!$el.prev('.preloader').length){ $('
    ').insertBefore($el); } $el.data('thegemPreloader', $('img, iframe', $el).add($el.filter('img, iframe')).length); if($el.data('thegemPreloader')==0){ $el.prev('.preloader').remove(); callback(); $el.trigger('thegem-preloader-loaded'); return; } $('img, iframe', $el).add($el.filter('img, iframe')).each(function(){ var $obj=$(''); if($(this).prop('tagName').toLowerCase()=='iframe'){ $obj=$(this); } $obj.attr('src', $(this).attr('src')); $obj.on('load error', function(){ $el.data('thegemPreloader', $el.data('thegemPreloader')-1); if($el.data('thegemPreloader')==0){ $el.prev('.preloader').remove(); callback(); $el.trigger('thegem-preloader-loaded'); }}); }); }); }})(jQuery); (function($){ var oWidth=$.fn.width; $.fn.width=function(argument){ if(arguments.length==0&&this.length==1&&this[0]===window){ if(window.gemOptions.innerWidth!=-1){ return window.gemOptions.innerWidth; } var width=oWidth.apply(this,arguments); window.updateGemInnerSize(width); return width; } return oWidth.apply(this,arguments); }; var $page=$('#page'); $(window).load(function(){ var $preloader=$('#page-preloader'); if($preloader.length&&!$preloader.hasClass('preloader-loaded')){ $preloader.addClass('preloader-loaded'); }}); $('#site-header.animated-header').headerAnimation(); if(!window.gemSettings.lasyDisabled&&$.support.opacity){ $('.wpb_text_column.wpb_animate_when_almost_visible.wpb_fade').each(function(){ $(this).wrap('
    ').addClass('lazy-loading-item').data('ll-effect', 'fading'); }); $('.gem-list.lazy-loading').each(function(){ $(this).data('ll-item-delay', '200'); $('li', this).addClass('lazy-loading-item').data('ll-effect', 'slide-right'); }); $.lazyLoading(); } $.fn.updateTabs=function(){ jQuery('.gem-tabs', this).each(function(index){ var $tabs=$(this); $tabs.thegemPreloader(function(){ $tabs.easyResponsiveTabs({ type: 'default', width: 'auto', fit: false, activate: function(currentTab, e){ var $tab=$(currentTab.target); var controls=$tab.attr('aria-controls'); $tab.closest('.ui-tabs').find('.gem_tab[aria-labelledby="' + controls + '"]').trigger('tab-update'); }}); }); }); jQuery('.gem-tour', this).each(function(index){ var $tabs=$(this); $tabs.thegemPreloader(function(){ $tabs.easyResponsiveTabs({ type: 'vertical', width: 'auto', fit: false, activate: function(currentTab, e){ var $tab=$(currentTab.target); var controls=$tab.attr('aria-controls'); $tab.closest('.ui-tabs').find('.gem_tab[aria-labelledby="' + controls + '"]').trigger('tab-update'); }}); }); }); }; function fullwidth_block_after_update($item){ $item.trigger('updateTestimonialsCarousel'); $item.trigger('updateClientsCarousel'); $item.trigger('fullwidthUpdate'); } function fullwidth_block_update($item, pageOffset, pagePaddingLeft, pageWidth,skipTrigger){ var $prevElement=$item.prev(); if($prevElement.length==0||$prevElement.hasClass('fullwidth-block')){ $prevElement=$item.parent(); } var offsetKey=window.gemSettings.isRTL ? 'right':'left'; var cssData={ width: pageWidth }; cssData[offsetKey]=pageOffset.left - ($prevElement.length ? $prevElement.offset().left:0) + parseInt(pagePaddingLeft) $item.css(cssData); if(!skipTrigger){ fullwidth_block_after_update($item); }} var inlineFullwidths=[], notInlineFullwidths=[]; $('.fullwidth-block').each(function(){ var $item=$(this), $parents=$item.parents('.vc_row'), fullw={ isInline: false }; $parents.each(function(){ if(this.hasAttribute('data-vc-full-width')){ fullw.isInline=true; return false; }}); if(fullw.isInline){ inlineFullwidths.push(this); }else{ notInlineFullwidths.push(this); }}); function update_fullwidths(inline, init){ var $needUpdate=[]; (inline ? inlineFullwidths:notInlineFullwidths).forEach(function(item){ $needUpdate.push(item); }); if($needUpdate.length > 0){ var pageOffset=$page.offset(), pagePaddingLeft=$page.css('padding-left'), pageWidth=$page.width(); $needUpdate.forEach(function(item){ fullwidth_block_update($(item), pageOffset, pagePaddingLeft, pageWidth); }); }} if(!window.disableGemSlideshowPreloaderHandle){ jQuery('.gem-slideshow').each(function(){ var $slideshow=$(this); $slideshow.thegemPreloader(function(){}); }); } $(function(){ $('#gem-icons-loading-hide').remove(); $('#thegem-preloader-inline-css').remove(); jQuery('iframe').not('.gem-video-background iframe').each(function(){ $(this).thegemPreloader(function(){}); }); jQuery('.gem-video-background').each(function(){ var $videoBG=$(this); var $videoContainer=$('.gem-video-background-inner', this); var ratio=$videoBG.data('aspect-ratio') ? $videoBG.data('aspect-ratio'):'16:9'; var regexp=/(\d+):(\d+)/; var $fullwidth=$videoBG.closest('.fullwidth-block'); ratio=regexp.exec(ratio); if(!ratio||parseInt(ratio[1])==0||parseInt(ratio[2])==0){ ratio=16/9; }else{ ratio=parseInt(ratio[1])/parseInt(ratio[2]); } function gemVideoUpdate(){ $videoContainer.removeAttr('style'); if($videoContainer.width() / $videoContainer.height() > ratio){ $videoContainer.css({ height: ($videoContainer.width() / ratio) + 'px', marginTop: -($videoContainer.width() / ratio - $videoBG.height()) / 2 + 'px' }); }else{ $videoContainer.css({ width: ($videoContainer.height() * ratio) + 'px', marginLeft: -($videoContainer.height() * ratio - $videoBG.width()) / 2 + 'px' }); }} if($videoBG.closest('.page-title-block').length > 0){ gemVideoUpdate(); } if($fullwidth.length){ $fullwidth.on('fullwidthUpdate', gemVideoUpdate); }else{ $(window).resize(gemVideoUpdate); }}); update_fullwidths(false, true); if(!window.gemSettings.parallaxDisabled){ $('.fullwidth-block').each(function(){ var $item=$(this), mobile_enabled=$item.data('mobile-parallax-enable')||'0'; if(!window.gemSettings.isTouch||mobile_enabled=='1'){ if($item.hasClass('fullwidth-block-parallax-vertical')){ $('.fullwidth-block-background', $item).parallaxVertical('50%'); }else if($item.hasClass('fullwidth-block-parallax-horizontal')){ $('.fullwidth-block-background', $item).parallaxHorizontal(); }}else{ $('.fullwidth-block-background', $item).css({ backgroundAttachment: 'scroll' }); }}); } $(window).resize(function(){ update_fullwidths(false, false); }); jQuery('select.gem-combobox, .gem-combobox select, .widget_archive select, .widget_product_categories select, .widget_layered_nav select, .widget_categories select').each(function(index){ $(this).combobox(); }); jQuery('input.gem-checkbox, .gem-checkbox input').checkbox(); if(typeof($.fn.ReStable)=="function"){ jQuery('.gem-table-responsive').each(function(index){ $('> table', this).ReStable({ maxWidth: 768, rowHeaders:$(this).hasClass('row-headers') }); }); } jQuery('.fancybox').each(function(){ $(this).fancybox(); }); function init_odometer(el){ if(jQuery('.gem-counter-odometer', el).size()==0) return; var odometer=jQuery('.gem-counter-odometer', el).get(0); var format=jQuery(el).closest('.gem-counter-box').data('number-format'); format=format ? format:'(ddd).ddd'; var od=new Odometer({ el: odometer, value: $(odometer).text(), format: format }); od.update($(odometer).data('to')); } window['thegem_init_odometer']=init_odometer; jQuery('.gem-counter').each(function(index){ if(jQuery(this).closest('.gem-counter-box').size() > 0&&jQuery(this).closest('.gem-counter-box').hasClass('lazy-loading')&&!window.gemSettings.lasyDisabled){ jQuery(this).addClass('lazy-loading-item').data('ll-effect', 'action').data('item-delay', '0').data('ll-action-func', 'thegem_init_odometer'); jQuery('.gem-icon', this).addClass('lazy-loading-item').data('ll-effect', 'fading').data('item-delay', '0'); jQuery('.gem-counter-text', this).addClass('lazy-loading-item').data('ll-effect', 'fading').data('item-delay', '0'); return; } init_odometer(this); }); jQuery('.panel-sidebar-sticky > .sidebar').scSticky(); jQuery('iframe + .map-locker').each(function(){ var $locker=$(this); $locker.click(function(e){ e.preventDefault(); if($locker.hasClass('disabled')){ $locker.prev('iframe').css({ 'pointer-events':'none' }); }else{ $locker.prev('iframe').css({ 'pointer-events':'auto' }); } $locker.toggleClass('disabled'); }); }); $('.primary-navigation a.mega-no-link').closest('li').removeClass('menu-item-active current-menu-item'); $('.primary-navigation a, .gem-button, .footer-navigation a, .scroll-top-button, .scroll-to-anchor, .scroll-to-anchor a, .top-area-menu a').each(function(){ var $anhor=$(this); var link=$anhor.attr('href'); if(!link) return ; link=link.split('#'); if($('#'+link[1]).length){ $anhor.closest('li').removeClass('menu-item-active current-menu-item'); $anhor.closest('li').parents('li').removeClass('menu-item-current'); $(window).scroll(function(){ if(!$anhor.closest('li.menu-item').length) return ; var correction=0; if(!$('#page').hasClass('vertical-header')){ correction=$('#site-header').outerHeight() + $('#site-header').position().top; } var target_top=$('#'+link[1]).offset().top - correction; if(getScrollY() >=target_top&&getScrollY() <=target_top + $('#'+link[1]).outerHeight()){ $anhor.closest('li').addClass('menu-item-active'); $anhor.closest('li').parents('li').addClass('menu-item-current'); }else{ $anhor.closest('li').removeClass('menu-item-active'); $anhor.closest('li').parents('li.menu-item-current').each(function(){ if(!$('.menu-item-active', this).length){ $(this).removeClass('menu-item-current'); }}); }}); $anhor.click(function(e){ e.preventDefault(); var correction=0; if($('#site-header.animated-header').length){ var shrink=$('#site-header').hasClass('shrink'); $('#site-header').addClass('scroll-counting'); $('#site-header').addClass('fixed shrink'); correction=$('#site-header').outerHeight() + $('#site-header').position().top; if(!shrink&&$('#top-area').length&&!$('#site-header').find('#top-area').length){ correction=correction - $('#top-area').outerHeight(); } if(!shrink){ $('#site-header').removeClass('fixed shrink'); } setTimeout(function(){ $('#site-header').removeClass('scroll-counting'); }, 50); } var target_top=$('#'+link[1]).offset().top - correction + 1; $('html, body').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutQuint'); }); } $(window).load(function(){ if(window.location.href==$anhor.attr('href')){ $anhor.click(); }}); }); $('body').on('click', '.post-footer-sharing .gem-button', function(e){ e.preventDefault(); $(this).closest('.post-footer-sharing').find('.sharing-popup').toggleClass('active'); }); $(window).scroll(function(){ if(getScrollY() > 0){ $('.scroll-top-button').addClass('visible'); }else{ $('.scroll-top-button').removeClass('visible'); }}).scroll(); function getScrollY(elem){ return window.pageYOffset||document.documentElement.scrollTop; } $('a.hidden-email').each(function(){ $(this).attr('href', 'mailto:'+$(this).data('name')+'@'+$(this).data('domain')); }); $('#colophon .footer-widget-area').thegemPreloader(function(){ $('#colophon .footer-widget-area').isotope({ itemSelector: '.widget', layoutMode: 'masonry' }); }); $('body').updateTabs(); }); $(document).on('show.vc.accordion', '[data-vc-accordion]', function(){ var $target=$(this).data('vc.accordion').getContainer(); var correction=0; if($target.find('.vc_tta-tabs').length&&!$(this).is(':visible')) return ; if($('#site-header.animated-header').length&&$('#site-header').hasClass('fixed')){ var shrink=$('#site-header').hasClass('shrink'); $('#site-header').addClass('scroll-counting'); $('#site-header').addClass('fixed shrink'); correction=$('#site-header').outerHeight() + $('#site-header').position().top; if(!shrink){ $('#site-header').removeClass('fixed shrink'); } $('#site-header').removeClass('scroll-counting'); } var target_top=$target.offset().top - correction - 100 + 1; $('html, body').stop(true, true).animate({scrollTop:target_top}, 500, 'easeInOutQuint'); }); var vc_update_fullwidth_init=true; $(document).on('vc-full-width-row', function(e){ if(window.gemOptions.clientWidth - $page.width() > 25||window.gemSettings.isRTL){ for (var i=1; i < arguments.length; i++){ var $el=$(arguments[i]); $el.addClass("vc_hidden"); var $el_full=$el.next(".vc_row-full-width"); $el_full.length||($el_full=$el.parent().next(".vc_row-full-width")); var el_margin_left=parseInt($el.css("margin-left"), 10), el_margin_right=parseInt($el.css("margin-right"), 10), offset=0 - $el_full.offset().left - el_margin_left + $('#page').offset().left + parseInt($('#page').css('padding-left')), width=$('#page').width(); var offsetKey=window.gemSettings.isRTL ? 'right':'left'; var cssData={ position: "relative", left: offset, "box-sizing": "border-box", width: $("#page").width() }; cssData[offsetKey]=offset; if($el.css(cssData), !$el.data("vcStretchContent")){ var padding=-1 * offset; 0 > padding&&(padding=0); var paddingRight=width - padding - $el_full.width() + el_margin_left + el_margin_right; 0 > paddingRight&&(paddingRight=0), $el.css({ "padding-left": padding + "px", "padding-right": paddingRight + "px" }) } $el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden"); }} update_fullwidths(true, vc_update_fullwidth_init); vc_update_fullwidth_init=false; }); })(jQuery); (function($){ $('.menu-item-search a').on('click', function(e){ e.preventDefault(); $('.menu-item-search').toggleClass('active'); }); })(jQuery); (function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); (function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({}, e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked|| !1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k= e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d, e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&& (d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive= !0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g, (new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a= b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents(); e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", !1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow"); a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth, v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x", "hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),cA||p>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&jA||p>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
    ').appendTo("body"); this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()}, close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0, !0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed|| this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"), H&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+ '"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(), b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('
    ').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery); (function($){ $('a.fancy, .fancy-link-inner a').fancybox(); $('a.fancy-gallery').fancybox({ helpers:{ title: { type: 'over' }}, wrapCSS: 'slideinfo', beforeLoad: function(){ var clone=$(this.element).children('.slide-info').clone(); if(clone.length){ this.title=clone.html(); }} }); $('.portfolio-item a.vimeo, .portfolio-item a.youtube, .blog article a.youtube, .blog article a.vimeo').fancybox({ type: 'iframe' }); $('.portfolio-item a.self_video').fancybox({ width: '80%', height: '80%', autoSize: false, content: '
    ', afterShow: function(){ var $video=$(''); $video.appendTo($('#fancybox-video')); $video.mediaelementplayer(); }}); })(jQuery); (function($){ $(function(){ $('body').updateAccordions(); }); $.fn.updateAccordions=function(){ $('.gem_accordion', this).each(function (index){ var $accordion=$(this); $accordion.thegemPreloader(function(){ var $tabs, interval=$accordion.attr("data-interval"), active_tab = !isNaN($accordion.data('active-tab'))&&parseInt($accordion.data('active-tab')) > 0 ? parseInt($accordion.data('active-tab')) - 1:false, collapsible=$accordion.data('collapsible')==='yes'; $tabs=$accordion.find('.gem_accordion_wrapper').accordion({ header:"> div > .gem_accordion_header", autoHeight:false, heightStyle:"content", active:active_tab, collapsible: collapsible, navigation:true, activate: function(event, ui){ if(ui.newPanel.size() > 0){ ui.newPanel.trigger('accordion-update'); }}, beforeActivate: function(event, ui){ if(ui.newPanel.size() > 0){ $("html, body").animate({ scrollTop: ui.newPanel.closest('.gem_accordion').offset().top - 200 }, 300); }} }); }); }); }})(jQuery); !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(b,d){var e,f,g,h=b.nodeName.toLowerCase();return"area"===h?(e=b.parentNode,f=e.name,!(!b.href||!f||"map"!==e.nodeName.toLowerCase())&&(g=a("img[usemap='#"+f+"']")[0],!!g&&c(g))):(/^(input|select|textarea|button|object)$/.test(h)?!b.disabled:"a"===h?b.href||d:d)&&c(b)}function c(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(b){var c=this.css("position"),d="absolute"===c,e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);return(!d||"static"!==b.css("position"))&&e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:a(this[0].ownerDocument||document)},uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(c){return b(c,!isNaN(a.attr(c,"tabindex")))},tabbable:function(c){var d=a.attr(c,"tabindex"),e=isNaN(d);return(e||d>=0)&&b(c,!e)}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(b,c){function d(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),f&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var e="Width"===c?["Left","Right"]:["Top","Bottom"],f=c.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+c]=function(b){return void 0===b?g["inner"+c].call(this):this.each(function(){a(this).css(f,d(this,b)+"px")})},a.fn["outer"+c]=function(b,e){return"number"!=typeof b?g["outer"+c].call(this,b):this.each(function(){a(this).css(f,d(this,b,!0,e)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),disableSelection:function(){var a="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(b){if(void 0!==b)return this.css("zIndex",b);if(this.length)for(var c,d,e=a(this[0]);e.length&&e[0]!==document;){if(c=e.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(d=parseInt(e.css("zIndex"),10),!isNaN(d)&&0!==d))return d;e=e.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;e
    "))}function d(b){var c="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return b.delegate(c,"mouseout",function(){a(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&a(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&a(this).removeClass("ui-datepicker-next-hover")}).delegate(c,"mouseover",e)}function e(){a.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),a(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&a(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&a(this).addClass("ui-datepicker-next-hover"))}function f(b,c){a.extend(b,c);for(var d in c)null==c[d]&&(b[d]=c[d]);return b}a.extend(a.ui,{datepicker:{version:"1.11.4"}});var g;return a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return f(this._defaults,a||{}),this},_attachDatepicker:function(b,c){var d,e,f;d=b.nodeName.toLowerCase(),e="div"===d||"span"===d,b.id||(this.uuid+=1,b.id="dp"+this.uuid),f=this._newInst(a(b),e),f.settings=a.extend({},c||{}),"input"===d?this._connectDatepicker(b,f):e&&this._inlineDatepicker(b,f)},_newInst:function(b,c){var e=b[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:e,input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:c?d(a("
    ")):this.dpDiv}},_connectDatepicker:function(b,c){var d=a(b);c.append=a([]),c.trigger=a([]),d.hasClass(this.markerClassName)||(this._attachments(d,c),d.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(c),a.data(b,"datepicker",c),c.settings.disabled&&this._disableDatepicker(b))},_attachments:function(b,c){var d,e,f,g=this._get(c,"appendText"),h=this._get(c,"isRTL");c.append&&c.append.remove(),g&&(c.append=a(""+g+""),b[h?"before":"after"](c.append)),b.unbind("focus",this._showDatepicker),c.trigger&&c.trigger.remove(),d=this._get(c,"showOn"),"focus"!==d&&"both"!==d||b.focus(this._showDatepicker),"button"!==d&&"both"!==d||(e=this._get(c,"buttonText"),f=this._get(c,"buttonImage"),c.trigger=a(this._get(c,"buttonImageOnly")?a("").addClass(this._triggerClass).attr({src:f,alt:e,title:e}):a("").addClass(this._triggerClass).html(f?a("").attr({src:f,alt:e,title:e}):e)),b[h?"before":"after"](c.trigger),c.trigger.click(function(){return a.datepicker._datepickerShowing&&a.datepicker._lastInput===b[0]?a.datepicker._hideDatepicker():a.datepicker._datepickerShowing&&a.datepicker._lastInput!==b[0]?(a.datepicker._hideDatepicker(),a.datepicker._showDatepicker(b[0])):a.datepicker._showDatepicker(b[0]),!1}))},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b,c,d,e,f=new Date(2009,11,20),g=this._get(a,"dateFormat");g.match(/[DM]/)&&(b=function(a){for(c=0,d=0,e=0;ec&&(c=a[e].length,d=e);return d},f.setMonth(b(this._get(a,g.match(/MM/)?"monthNames":"monthNamesShort"))),f.setDate(b(this._get(a,g.match(/DD/)?"dayNames":"dayNamesShort"))+20-f.getDay())),a.input.attr("size",this._formatDate(a,f).length)}},_inlineDatepicker:function(b,c){var d=a(b);d.hasClass(this.markerClassName)||(d.addClass(this.markerClassName).append(c.dpDiv),a.data(b,"datepicker",c),this._setDate(c,this._getDefaultDate(c),!0),this._updateDatepicker(c),this._updateAlternate(c),c.settings.disabled&&this._disableDatepicker(b),c.dpDiv.css("display","block"))},_dialogDatepicker:function(b,c,d,e,g){var h,i,j,k,l,m=this._dialogInst;return m||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=a(""),this._dialogInput.keydown(this._doKeyDown),a("body").append(this._dialogInput),m=this._dialogInst=this._newInst(this._dialogInput,!1),m.settings={},a.data(this._dialogInput[0],"datepicker",m)),f(m.settings,e||{}),c=c&&c.constructor===Date?this._formatDate(m,c):c,this._dialogInput.val(c),this._pos=g?g.length?g:[g.pageX,g.pageY]:null,this._pos||(i=document.documentElement.clientWidth,j=document.documentElement.clientHeight,k=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[i/2-100+k,j/2-150+l]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),m.settings.onSelect=d,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),a.blockUI&&a.blockUI(this.dpDiv),a.data(this._dialogInput[0],"datepicker",m),this},_destroyDatepicker:function(b){var c,d=a(b),e=a.data(b,"datepicker");d.hasClass(this.markerClassName)&&(c=b.nodeName.toLowerCase(),a.removeData(b,"datepicker"),"input"===c?(e.append.remove(),e.trigger.remove(),d.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==c&&"span"!==c||d.removeClass(this.markerClassName).empty(),g===e&&(g=null))},_enableDatepicker:function(b){var c,d,e=a(b),f=a.data(b,"datepicker");e.hasClass(this.markerClassName)&&(c=b.nodeName.toLowerCase(),"input"===c?(b.disabled=!1,f.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==c&&"span"!==c||(d=e.children("."+this._inlineClass),d.children().removeClass("ui-state-disabled"),d.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=a.map(this._disabledInputs,function(a){return a===b?null:a}))},_disableDatepicker:function(b){var c,d,e=a(b),f=a.data(b,"datepicker");e.hasClass(this.markerClassName)&&(c=b.nodeName.toLowerCase(),"input"===c?(b.disabled=!0,f.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==c&&"span"!==c||(d=e.children("."+this._inlineClass),d.children().addClass("ui-state-disabled"),d.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=a.map(this._disabledInputs,function(a){return a===b?null:a}),this._disabledInputs[this._disabledInputs.length]=b)},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1},_doKeyUp:function(b){var c,d=a.datepicker._getInst(b.target);if(d.input.val()!==d.lastVal)try{c=a.datepicker.parseDate(a.datepicker._get(d,"dateFormat"),d.input?d.input.val():null,a.datepicker._getFormatConfig(d)),c&&(a.datepicker._setDateFromField(d),a.datepicker._updateAlternate(d),a.datepicker._updateDatepicker(d))}catch(e){}return!0},_showDatepicker:function(c){if(c=c.target||c,"input"!==c.nodeName.toLowerCase()&&(c=a("input",c.parentNode)[0]),!a.datepicker._isDisabledDatepicker(c)&&a.datepicker._lastInput!==c){var d,e,g,h,i,j,k;d=a.datepicker._getInst(c),a.datepicker._curInst&&a.datepicker._curInst!==d&&(a.datepicker._curInst.dpDiv.stop(!0,!0),d&&a.datepicker._datepickerShowing&&a.datepicker._hideDatepicker(a.datepicker._curInst.input[0])),e=a.datepicker._get(d,"beforeShow"),g=e?e.apply(c,[c,d]):{},g!==!1&&(f(d.settings,g),d.lastVal=null,a.datepicker._lastInput=c,a.datepicker._setDateFromField(d),a.datepicker._inDialog&&(c.value=""),a.datepicker._pos||(a.datepicker._pos=a.datepicker._findPos(c),a.datepicker._pos[1]+=c.offsetHeight),h=!1,a(c).parents().each(function(){return h|="fixed"===a(this).css("position"),!h}),i={left:a.datepicker._pos[0],top:a.datepicker._pos[1]},a.datepicker._pos=null,d.dpDiv.empty(),d.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),a.datepicker._updateDatepicker(d),i=a.datepicker._checkOffset(d,i,h),d.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":h?"fixed":"absolute",display:"none",left:i.left+"px",top:i.top+"px"}),d.inline||(j=a.datepicker._get(d,"showAnim"),k=a.datepicker._get(d,"duration"),d.dpDiv.css("z-index",b(a(c))+1),a.datepicker._datepickerShowing=!0,a.effects&&a.effects.effect[j]?d.dpDiv.show(j,a.datepicker._get(d,"showOptions"),k):d.dpDiv[j||"show"](j?k:null),a.datepicker._shouldFocusInput(d)&&d.input.focus(),a.datepicker._curInst=d))}},_updateDatepicker:function(b){this.maxRows=4,g=b,b.dpDiv.empty().append(this._generateHTML(b)),this._attachHandlers(b);var c,d=this._getNumberOfMonths(b),f=d[1],h=17,i=b.dpDiv.find("."+this._dayOverClass+" a");i.length>0&&e.apply(i.get(0)),b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&b.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",h*f+"em"),b.dpDiv[(1!==d[0]||1!==d[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),b.dpDiv[(this._get(b,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),b===a.datepicker._curInst&&a.datepicker._datepickerShowing&&a.datepicker._shouldFocusInput(b)&&b.input.focus(),b.yearshtml&&(c=b.yearshtml,setTimeout(function(){c===b.yearshtml&&b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml),c=b.yearshtml=null},0))},_shouldFocusInput:function(a){return a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&!a.input.is(":focus")},_checkOffset:function(b,c,d){var e=b.dpDiv.outerWidth(),f=b.dpDiv.outerHeight(),g=b.input?b.input.outerWidth():0,h=b.input?b.input.outerHeight():0,i=document.documentElement.clientWidth+(d?0:a(document).scrollLeft()),j=document.documentElement.clientHeight+(d?0:a(document).scrollTop());return c.left-=this._get(b,"isRTL")?e-g:0,c.left-=d&&c.left===b.input.offset().left?a(document).scrollLeft():0,c.top-=d&&c.top===b.input.offset().top+h?a(document).scrollTop():0,c.left-=Math.min(c.left,c.left+e>i&&i>e?Math.abs(c.left+e-i):0),c.top-=Math.min(c.top,c.top+f>j&&j>f?Math.abs(f+h):0),c},_findPos:function(b){for(var c,d=this._getInst(b),e=this._get(d,"isRTL");b&&("hidden"===b.type||1!==b.nodeType||a.expr.filters.hidden(b));)b=b[e?"previousSibling":"nextSibling"];return c=a(b).offset(),[c.left,c.top]},_hideDatepicker:function(b){var c,d,e,f,g=this._curInst;!g||b&&g!==a.data(b,"datepicker")||this._datepickerShowing&&(c=this._get(g,"showAnim"),d=this._get(g,"duration"),e=function(){a.datepicker._tidyDialog(g)},a.effects&&(a.effects.effect[c]||a.effects[c])?g.dpDiv.hide(c,a.datepicker._get(g,"showOptions"),d,e):g.dpDiv["slideDown"===c?"slideUp":"fadeIn"===c?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1,f=this._get(g,"onClose"),f&&f.apply(g.input?g.input[0]:null,[g.input?g.input.val():"",g]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),a.blockUI&&(a.unblockUI(),a("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(b){if(a.datepicker._curInst){var c=a(b.target),d=a.datepicker._getInst(c[0]);(c[0].id===a.datepicker._mainDivId||0!==c.parents("#"+a.datepicker._mainDivId).length||c.hasClass(a.datepicker.markerClassName)||c.closest("."+a.datepicker._triggerClass).length||!a.datepicker._datepickerShowing||a.datepicker._inDialog&&a.blockUI)&&(!c.hasClass(a.datepicker.markerClassName)||a.datepicker._curInst===d)||a.datepicker._hideDatepicker()}},_adjustDate:function(b,c,d){var e=a(b),f=this._getInst(e[0]);this._isDisabledDatepicker(e[0])||(this._adjustInstDate(f,c+("M"===d?this._get(f,"showCurrentAtPos"):0),d),this._updateDatepicker(f))},_gotoToday:function(b){var c,d=a(b),e=this._getInst(d[0]);this._get(e,"gotoCurrent")&&e.currentDay?(e.selectedDay=e.currentDay,e.drawMonth=e.selectedMonth=e.currentMonth,e.drawYear=e.selectedYear=e.currentYear):(c=new Date,e.selectedDay=c.getDate(),e.drawMonth=e.selectedMonth=c.getMonth(),e.drawYear=e.selectedYear=c.getFullYear()),this._notifyChange(e),this._adjustDate(d)},_selectMonthYear:function(b,c,d){var e=a(b),f=this._getInst(e[0]);f["selected"+("M"===d?"Month":"Year")]=f["draw"+("M"===d?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10),this._notifyChange(f),this._adjustDate(e)},_selectDay:function(b,c,d,e){var f,g=a(b);a(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(g[0])||(f=this._getInst(g[0]),f.selectedDay=f.currentDay=a("a",e).html(),f.selectedMonth=f.currentMonth=c,f.selectedYear=f.currentYear=d,this._selectDate(b,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(b){var c=a(b);this._selectDate(c,"")},_selectDate:function(b,c){var d,e=a(b),f=this._getInst(e[0]);c=null!=c?c:this._formatDate(f),f.input&&f.input.val(c),this._updateAlternate(f),d=this._get(f,"onSelect"),d?d.apply(f.input?f.input[0]:null,[c,f]):f.input&&f.input.trigger("change"),f.inline?this._updateDatepicker(f):(this._hideDatepicker(),this._lastInput=f.input[0],"object"!=typeof f.input[0]&&f.input.focus(),this._lastInput=null)},_updateAlternate:function(b){var c,d,e,f=this._get(b,"altField");f&&(c=this._get(b,"altFormat")||this._get(b,"dateFormat"),d=this._getDate(b),e=this.formatDate(c,d,this._getFormatConfig(b)),a(f).each(function(){a(this).val(e)}))},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b,c=new Date(a.getTime());return c.setDate(c.getDate()+4-(c.getDay()||7)),b=c.getTime(),c.setMonth(0),c.setDate(1),Math.floor(Math.round((b-c)/864e5)/7)+1},parseDate:function(b,c,d){if(null==b||null==c)throw"Invalid arguments";if(c="object"==typeof c?c.toString():c+"",""===c)return null;var e,f,g,h,i=0,j=(d?d.shortYearCutoff:null)||this._defaults.shortYearCutoff,k="string"!=typeof j?j:(new Date).getFullYear()%100+parseInt(j,10),l=(d?d.dayNamesShort:null)||this._defaults.dayNamesShort,m=(d?d.dayNames:null)||this._defaults.dayNames,n=(d?d.monthNamesShort:null)||this._defaults.monthNamesShort,o=(d?d.monthNames:null)||this._defaults.monthNames,p=-1,q=-1,r=-1,s=-1,t=!1,u=function(a){var c=e+1-1)for(q=1,r=s;;){if(f=this._getDaysInMonth(p,q-1),r<=f)break;q++,r-=f}if(h=this._daylightSavingAdjust(new Date(p,q-1,r)),h.getFullYear()!==p||h.getMonth()+1!==q||h.getDate()!==r)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d,e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=function(b){var c=d+112?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),e===a.selectedMonth&&f===a.selectedYear||c||this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&""===a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_attachHandlers:function(b){var c=this._get(b,"stepMonths"),d="#"+b.id.replace(/\\\\/g,"\\");b.dpDiv.find("[data-handler]").map(function(){var b={prev:function(){a.datepicker._adjustDate(d,-c,"M")},next:function(){a.datepicker._adjustDate(d,+c,"M")},hide:function(){a.datepicker._hideDatepicker()},today:function(){a.datepicker._gotoToday(d)},selectDay:function(){return a.datepicker._selectDay(d,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return a.datepicker._selectMonthYear(d,this,"M"),!1},selectYear:function(){return a.datepicker._selectMonthYear(d,this,"Y"),!1}};a(this).bind(this.getAttribute("data-event"),b[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O=new Date,P=this._daylightSavingAdjust(new Date(O.getFullYear(),O.getMonth(),O.getDate())),Q=this._get(a,"isRTL"),R=this._get(a,"showButtonPanel"),S=this._get(a,"hideIfNoPrevNext"),T=this._get(a,"navigationAsDateFormat"),U=this._getNumberOfMonths(a),V=this._get(a,"showCurrentAtPos"),W=this._get(a,"stepMonths"),X=1!==U[0]||1!==U[1],Y=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),Z=this._getMinMaxDate(a,"min"),$=this._getMinMaxDate(a,"max"),_=a.drawMonth-V,aa=a.drawYear;if(_<0&&(_+=12,aa--),$)for(b=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-U[0]*U[1]+1,$.getDate())),b=Z&&bb;)_--,_<0&&(_=11,aa--);for(a.drawMonth=_,a.drawYear=aa,c=this._get(a,"prevText"),c=T?this.formatDate(c,this._daylightSavingAdjust(new Date(aa,_-W,1)),this._getFormatConfig(a)):c,d=this._canAdjustMonth(a,-1,aa,_)?"
    "+c+"":S?"":""+c+"",e=this._get(a,"nextText"),e=T?this.formatDate(e,this._daylightSavingAdjust(new Date(aa,_+W,1)),this._getFormatConfig(a)):e,f=this._canAdjustMonth(a,1,aa,_)?""+e+"":S?"":""+e+"",g=this._get(a,"currentText"),h=this._get(a,"gotoCurrent")&&a.currentDay?Y:P,g=T?this.formatDate(g,h,this._getFormatConfig(a)):g,i=a.inline?"":"",j=R?"
    "+(Q?i:"")+(this._isInRange(a,h)?"":"")+(Q?"":i)+"
    ":"",k=parseInt(this._get(a,"firstDay"),10),k=isNaN(k)?0:k,l=this._get(a,"showWeek"),m=this._get(a,"dayNames"),n=this._get(a,"dayNamesMin"),o=this._get(a,"monthNames"),p=this._get(a,"monthNamesShort"),q=this._get(a,"beforeShowDay"),r=this._get(a,"showOtherMonths"),s=this._get(a,"selectOtherMonths"),t=this._getDefaultDate(a),u="",w=0;w1)switch(y){case 0:B+=" ui-datepicker-group-first",A=" ui-corner-"+(Q?"right":"left");break;case U[1]-1:B+=" ui-datepicker-group-last",A=" ui-corner-"+(Q?"left":"right");break;default:B+=" ui-datepicker-group-middle",A=""}B+="'>"}for(B+="
    "+(/all|left/.test(A)&&0===w?Q?f:d:"")+(/all|right/.test(A)&&0===w?Q?d:f:"")+this._generateMonthYearHeader(a,_,aa,Z,$,w>0||y>0,o,p)+"
    ",C=l?"":"",v=0;v<7;v++)D=(v+k)%7,C+="";for(B+=C+"",E=this._getDaysInMonth(aa,_),aa===a.selectedYear&&_===a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,E)),F=(this._getFirstDayOfMonth(aa,_)-k+7)%7,G=Math.ceil((F+E)/7),H=X&&this.maxRows>G?this.maxRows:G,this.maxRows=H,I=this._daylightSavingAdjust(new Date(aa,_,1-F)),J=0;J",K=l?"":"",v=0;v<7;v++)L=q?q.apply(a.input?a.input[0]:null,[I]):[!0,""],M=I.getMonth()!==_,N=M&&!s||!L[0]||Z&&I$,K+="",I.setDate(I.getDate()+1),I=this._daylightSavingAdjust(I);B+=K+""}_++,_>11&&(_=0,aa++),B+="
    "+this._get(a,"weekHeader")+"=5?" class='ui-datepicker-week-end'":"")+">"+n[D]+"
    "+this._get(a,"calculateWeek")(I)+""+(M&&!r?" ":N?""+I.getDate()+"":""+I.getDate()+"")+"
    "+(X?"
    "+(U[0]>0&&y===U[1]-1?"
    ":""):""),x+=B}u+=x}return u+=j,a._keyEvent=!1,u},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q=this._get(a,"changeMonth"),r=this._get(a,"changeYear"),s=this._get(a,"showMonthAfterYear"),t="
    ",u="";if(f||!q)u+=""+g[b]+"";else{ for(i=d&&d.getFullYear()===c,j=e&&e.getFullYear()===c,u+=""}if(s||(t+=u+(!f&&q&&r?"":" ")),!a.yearshtml)if(a.yearshtml="",f||!r)t+=""+c+"";else{for(l=this._get(a,"yearRange").split(":"),m=(new Date).getFullYear(),n=function(a){var b=a.match(/c[+\-].*/)?c+parseInt(a.substring(1),10):a.match(/[+\-].*/)?m+parseInt(a,10):parseInt(a,10);return isNaN(b)?m:b},o=n(l[0]),p=Math.max(o,n(l[1]||"")),o=d?Math.max(o,d.getFullYear()):o,p=e?Math.min(p,e.getFullYear()):p,a.yearshtml+="",t+=a.yearshtml,a.yearshtml=null}return t+=this._get(a,"yearSuffix"),s&&(t+=(!f&&q&&r?"":" ")+u),t+="
    "},_adjustInstDate:function(a,b,c){var d=a.drawYear+("Y"===c?b:0),e=a.drawMonth+("M"===c?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+("D"===c?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),"M"!==c&&"Y"!==c||this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return null==b?[1,1]:"number"==typeof b?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return new Date(a,b,1).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c,d,e=this._getMinMaxDate(a,"min"),f=this._getMinMaxDate(a,"max"),g=null,h=null,i=this._get(a,"yearRange");return i&&(c=i.split(":"),d=(new Date).getFullYear(),g=parseInt(c[0],10),h=parseInt(c[1],10),c[0].match(/[+\-].*/)&&(g+=d),c[1].match(/[+\-].*/)&&(h+=d)),(!e||b.getTime()>=e.getTime())&&(!f||b.getTime()<=f.getTime())&&(!g||b.getFullYear()>=g)&&(!h||b.getFullYear()<=h)},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?"object"==typeof b?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),a.fn.datepicker=function(b){if(!this.length)return this;a.datepicker.initialized||(a(document).mousedown(a.datepicker._checkExternalClick),a.datepicker.initialized=!0),0===a("#"+a.datepicker._mainDivId).length&&a("body").append(a.datepicker.dpDiv);var c=Array.prototype.slice.call(arguments,1);return"string"!=typeof b||"isDisabled"!==b&&"getDate"!==b&&"widget"!==b?"option"===b&&2===arguments.length&&"string"==typeof arguments[1]?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c)):this.each(function(){"string"==typeof b?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this].concat(c)):a.datepicker._attachDatepicker(this,b)}):a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c))},a.datepicker=new c,a.datepicker.initialized=!1,a.datepicker.uuid=(new Date).getTime(),a.datepicker.version="1.11.4",a.datepicker});